From 4ebd950a11be0d3397d9f2e59796522703ee9617 Mon Sep 17 00:00:00 2001 From: Motea Marius Date: Sun, 10 Mar 2024 20:03:00 +0200 Subject: [PATCH] Allow enable/disable motion sensor from HA using v2 api --- BridgeEmulator/flaskUI/v2restapi.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/BridgeEmulator/flaskUI/v2restapi.py b/BridgeEmulator/flaskUI/v2restapi.py index 086bfbefd..647d41b1c 100644 --- a/BridgeEmulator/flaskUI/v2restapi.py +++ b/BridgeEmulator/flaskUI/v2restapi.py @@ -22,7 +22,7 @@ v2Resources = {"light": {}, "scene": {}, "grouped_light": {}, "room": {}, "zone": { }, "entertainment": {}, "entertainment_configuration": {}, "zigbee_connectivity": {}, "zigbee_device_discovery": {}, "device": {}, "device_power": {}, -"geofence_client": {}} +"geofence_client": {}, "motion": {}} def getObject(element, v2uuid): @@ -589,6 +589,9 @@ def put(self, resource, resourceid): elif resource == "device": if putDict["identify"]["action"] == "identify": object.setV1State({"alert": "select"}) + elif resource == "motion": + if "enabled" in putDict: + object.update_attr({"config": {"on": putDict["enabled"]}}) else: return { "errors": [{