Skip to content

Commit bbbec9b

Browse files
Fix wrong response, add all buttons to response (diyhue#980)
* 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
1 parent 95dcb14 commit bbbec9b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

BridgeEmulator/HueObjects/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1834,7 +1834,7 @@ def getDevice(self):
18341834
"rtype": "temperature"
18351835
}]
18361836
result["type"] = "device"
1837-
elif self.modelid == "RWL022":
1837+
elif self.modelid == "RWL022" or self.modelid == "RWL021" or self.modelid == "RWL020":
18381838
result = {"id": self.id_v2, "id_v1": "/sensors/" + self.id_v1, "type": "device"}
18391839
result["product_data"] = {"model_id": self.modelid,
18401840
"manufacturer_name": "Signify Netherlands B.V.",
@@ -1909,7 +1909,7 @@ def getZigBee(self):
19091909
return result
19101910
def getButtons(self):
19111911
result = []
1912-
if self.modelid == "RWL022":
1912+
if self.modelid == "RWL022" or self.modelid == "RWL021" or self.modelid == "RWL020":
19131913
for button in range(4):
19141914
result.append({
19151915
"id": str(uuid.uuid5(uuid.NAMESPACE_URL, self.id_v2 + 'button' + str(button + 1))),

BridgeEmulator/flaskUI/v2restapi.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ def get(self, resource):
366366
buttons = sensor.getButtons()
367367
if len(buttons) != 0:
368368
for button in buttons:
369-
data.append(button)
369+
response["data"].append(button)
370370
else:
371371
response["errors"].append({"description": "Not Found"})
372372
del response["data"]

0 commit comments

Comments
 (0)