Skip to content

Commit b9ea78a

Browse files
committed
allow room edit (name and lights)
1 parent 3fb210a commit b9ea78a

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

BridgeEmulator/flaskUI/v2restapi.py

+13
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,19 @@ def put(self, resource, resourceid):
499499
bridgeConfig["sensors"]["1"].config["configured"] = True
500500
elif resource == "behavior_instance":
501501
object.update_attr(putDict)
502+
elif resource in ["room", "zone"]:
503+
v1Api = {}
504+
if "metadata" in putDict:
505+
if "name" in putDict["metadata"]:
506+
v1Api["name"] = putDict["metadata"]["name"]
507+
if "archetype" in putDict["metadata"]:
508+
v1Api["icon_class"] = putDict["metadata"]["archetype"].replace("_", " ")
509+
if "children" in putDict:
510+
for children in putDict["children"]:
511+
obj = getObject(
512+
children["rtype"], children["rid"])
513+
object.add_light(obj)
514+
object.update_attr(v1Api)
502515
response = {"data": [{
503516
"rid": resourceid,
504517
"rtype": resource

0 commit comments

Comments
 (0)