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

Commit 66b78f1

Browse files
committed
Switched back to Value objects for properties
1 parent 36a38a9 commit 66b78f1

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

example/single-thing.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from __future__ import division
2-
from webthing import Action, Event, Property, Thing, WebThingServer
2+
from webthing import Action, Event, Property, Value, Thing, WebThingServer
33
import logging
44
import time
55
import uuid
@@ -24,7 +24,7 @@ def make_thing():
2424
on_property = Property(
2525
thing,
2626
"on",
27-
initial_value=True,
27+
Value(True, None, lambda x: print(x)),
2828
metadata={
2929
"@type": "OnOffProperty",
3030
"title": "On/Off",
@@ -36,7 +36,7 @@ def make_thing():
3636
brightness_property = Property(
3737
thing,
3838
"brightness",
39-
initial_value=50,
39+
Value(50, None, lambda x: print(x)),
4040
metadata={
4141
"@type": "BrightnessProperty",
4242
"title": "Brightness",
@@ -68,7 +68,7 @@ def fade_function(args):
6868
fade_action = Action(
6969
thing,
7070
"fade",
71-
invokeaction=async_fade_function,
71+
async_fade_function,
7272
metadata={
7373
"title": "Fade",
7474
"description": "Fade the lamp to a given level",

0 commit comments

Comments
 (0)