Skip to content

Commit

Permalink
Fix wrong response, add all buttons to response (#980)
Browse files Browse the repository at this point in the history
* Update discover.py

* Update configHandler.py

* end wake up

* Update v2restapi.py

Add behavior instance to clip/v2/resource, to solve problem as in issue 873, now the app shows the automations

* wrong response

* add all buttons to response
  • Loading branch information
hendriksen-mark authored Dec 28, 2023
1 parent 95dcb14 commit bbbec9b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions BridgeEmulator/HueObjects/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1834,7 +1834,7 @@ def getDevice(self):
"rtype": "temperature"
}]
result["type"] = "device"
elif self.modelid == "RWL022":
elif self.modelid == "RWL022" or self.modelid == "RWL021" or self.modelid == "RWL020":
result = {"id": self.id_v2, "id_v1": "/sensors/" + self.id_v1, "type": "device"}
result["product_data"] = {"model_id": self.modelid,
"manufacturer_name": "Signify Netherlands B.V.",
Expand Down Expand Up @@ -1909,7 +1909,7 @@ def getZigBee(self):
return result
def getButtons(self):
result = []
if self.modelid == "RWL022":
if self.modelid == "RWL022" or self.modelid == "RWL021" or self.modelid == "RWL020":
for button in range(4):
result.append({
"id": str(uuid.uuid5(uuid.NAMESPACE_URL, self.id_v2 + 'button' + str(button + 1))),
Expand Down
2 changes: 1 addition & 1 deletion BridgeEmulator/flaskUI/v2restapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ def get(self, resource):
buttons = sensor.getButtons()
if len(buttons) != 0:
for button in buttons:
data.append(button)
response["data"].append(button)
else:
response["errors"].append({"description": "Not Found"})
del response["data"]
Expand Down

0 comments on commit bbbec9b

Please sign in to comment.