Skip to content

Commit

Permalink
fix update sequence element #0 has length 1; 2 is required
Browse files Browse the repository at this point in the history
  • Loading branch information
mariusmotea authored Mar 17, 2023
1 parent cfa33f7 commit 369b96f
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions BridgeEmulator/flaskUI/v2restapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,20 +513,18 @@ def put(self, resource, resourceid):
if "action" in putDict:
if putDict["action"] == "start":
logging.info("start hue entertainment")
object.stream.update(
{"active": True, "owner": authorisation["user"].username, "proxymode": "auto", "proxynode": "/bridge"})
Thread(target=entertainmentService, args=[
object, authorisation["user"]]).start()
for light in object.lights:
light().update_attr({"state": {"mode": "streaming"}})
object.update_attr({"stream": {"active": True, "owner": authorisation["user"].username, "proxymode": "auto", "proxynode": "/bridge"}})
sleep(1)
elif putDict["action"] == "stop":
logging.info("stop entertainment")
object.stream["active"] = False
for light in object.lights:
light().update_attr({"state": {"mode": "homeautomation"}})
light().update_attr({"state": {"mode": "homeautomation"}})
Popen(["killall", "openssl"])
object.update_attr(putDict)
object.update_attr({"stream": {"active": False}})
elif resource == "scene":
if "recall" in putDict:
object.activate(putDict)
Expand Down

0 comments on commit 369b96f

Please sign in to comment.