This repository was archived by the owner on Jun 7, 2021. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -51,7 +51,21 @@ Now we can add the required properties.
5151
5252The on property reports and sets the on/off state of the light. For
5353this, 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
5569to log the new state if the light is switched on/off.
5670
5771``` python
You can’t perform that action at this time.
0 commit comments