Skip to content

Commit

Permalink
added group id for rooms on info page, addressing #30
Browse files Browse the repository at this point in the history
  • Loading branch information
En3rGy committed Sep 3, 2023
1 parent 448f5ab commit 1243d3f
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 3 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,12 @@ Set up an instance of the logic module for each hue item you would like to contr

### Change Log

- v3.7: Identified group id for rooms on info page addressing [#30](https://github.com/En3rGy/14100_Hue/issues/30)
- v4.6: Improved unit tests
- v3.5:
- Work-around-fix of [0, 255, 0] results in yello -green: Removed check if color in in reach of lamp (https://github.com/En3rGy/14100_Hue/issues/27)
- Work-around-fix of [0, 255, 0] results in yellow-green: Removed check if color in in reach of lamp (https://github.com/En3rGy/14100_Hue/issues/27)
- v3.4:
- Refactoring
- Refactoring
- v3.3:
- Detecting broken connections to Hue Bridge
- Corrected input IDs in docu
Expand Down
2 changes: 1 addition & 1 deletion config.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<config>
<modules>
<module category="Datenaustausch" context="14100_Hue" id="14100" name="Hue Group (14100)" version="3.6">
<module category="Datenaustausch" context="14100_Hue" id="14100" name="Hue Group (14100)" version="3.7">
<inputs>
<input type="number" const_name="trigger" init_value="0">Get Status</input>
<input type="string" const_name="hue_key" init_value="">Key</input>
Expand Down
27 changes: 27 additions & 0 deletions libs/hue_lib/hue_bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,36 @@ def get_html_device_list(self):

global devices

rooms = {}

for device in devices.values():
info_data += str(device)

if device.room_name:
if device.room_name not in rooms:
rooms[device.room_name] = {}
rooms[device.room_name]["group_id"] = device.grouped_lights
else:
existing_list = rooms[device.room_name]["group_id"]
rooms[device.room_name]["group_id"] = list(set(existing_list) & set(device.grouped_lights))

rooms[device.room_name]["room_id"] = device.room

for room_name in rooms.keys():
room = rooms[room_name]
group_id = room["group_id"][0]
info_data = (info_data + "<tr>" +
"<td>{}</td>".format(room_name) +
"<td>-</td>" +
"<td>-</td>" +
"<td>-</td>" +
"<td>{}</td>".format(group_id) +
"<td>-</td>" +
"<td>{}</td>".format(room["room_id"]) +
"<td>-</td>" +
"<td>-</td>" +
"</tr>\n")

info_data += "</table>\n</html>\n"

return info_data
Expand Down

0 comments on commit 1243d3f

Please sign in to comment.