Skip to content

Commit

Permalink
Allow enable/disable motion sensor from HA using v2 api
Browse files Browse the repository at this point in the history
  • Loading branch information
mariusmotea authored Mar 10, 2024
1 parent a242d62 commit 4ebd950
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion BridgeEmulator/flaskUI/v2restapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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": [{
Expand Down

0 comments on commit 4ebd950

Please sign in to comment.