Skip to content
This repository was archived by the owner on Jun 7, 2021. It is now read-only.

Commit 595621e

Browse files
authored
Update README.md
1 parent 9a64285 commit 595621e

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,21 @@ Now we can add the required properties.
5151

5252
The on property reports and sets the on/off state of the light. For
5353
this, we need to have a Value object which holds the actual state and
54-
also a method to turn the light on/off. For our purposes, we just want
54+
also a method to turn the light on/off.
55+
56+
A `Value` object takes 3 main arguments: an initial value,
57+
an optional read function, and an optional write function.
58+
If no read/write functions are provided, the Value will store
59+
hold it's return value internally, and supports reading and writing
60+
from the web API.
61+
If a read function is given, this will be called to update the internal
62+
return value every time the Value's `get` method is called.
63+
If a write function is given, the new value will be forwarded to it as
64+
an argument whenever the Value's `set` method is called.
65+
These functions can be used to read and write Values to physical
66+
hardware, or for logging and data processing.
67+
68+
For our purposes, we just want
5569
to log the new state if the light is switched on/off.
5670

5771
```python

0 commit comments

Comments
 (0)