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

Commit cba68c1

Browse files
committed
Removed unused synchronous fade function
1 parent 205fda7 commit cba68c1

1 file changed

Lines changed: 3 additions & 10 deletions

File tree

example/single-thing.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,24 +51,17 @@ def make_thing():
5151
thing.add_property(on_property)
5252
thing.add_property(brightness_property)
5353

54-
async def async_fade_function(args):
54+
async def fade_function(args):
5555
print("Starting fade function")
5656
await asyncio.sleep(args["duration"] / 1000)
57-
brightness_property.set_value(args["brightness"])
58-
print("Finished fade function")
59-
return "Return value"
60-
61-
def fade_function(args):
62-
print("Starting fade function")
63-
time.sleep(args["duration"] / 1000)
64-
brightness_property.set_value(args["brightness"])
57+
await brightness_property.set_value(args["brightness"])
6558
print("Finished fade function")
6659
return "Return value"
6760

6861
fade_action = Action(
6962
thing,
7063
"fade",
71-
async_fade_function,
64+
fade_function,
7265
metadata={
7366
"title": "Fade",
7467
"description": "Fade the lamp to a given level",

0 commit comments

Comments
 (0)