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

Commit 08c0fd4

Browse files
author
Joel Collins
committed
Added Value argument comments
1 parent 595621e commit 08c0fd4

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ First we create a new Thing:
4040

4141
```python
4242
light = Thing(
43-
'urn:dev:ops:my-lamp-1234',
44-
'My Lamp',
45-
['OnOffSwitch', 'Light'],
46-
'A web connected lamp'
43+
'urn:dev:ops:my-lamp-1234', # Thing ID
44+
'My Lamp', # Thing name
45+
['OnOffSwitch', 'Light'], # Thing @type capabilities
46+
'A web connected lamp' # Thing description
4747
)
4848
```
4949

@@ -73,7 +73,11 @@ light.add_property(
7373
Property(
7474
light,
7575
'on',
76-
Value(True, None, lambda x: print(x)),
76+
Value(
77+
True, # Initial value
78+
None, # Read forwarder
79+
lambda x: print(x) # Write forwarder
80+
),
7781
metadata={
7882
'@type': 'OnOffProperty',
7983
'title': 'On/Off',

0 commit comments

Comments
 (0)