Skip to content

Commit 24af1d9

Browse files
committed
Collect group sensors
1 parent f294716 commit 24af1d9

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

plugwise/common.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
from plugwise.util import (
2222
check_heater_central,
2323
check_model,
24+
format_measure,
2425
get_vendor_name,
2526
return_valid,
2627
)
@@ -209,12 +210,22 @@ def _get_groups(self) -> dict[str, GwEntityData]:
209210
if item.attrib["id"] in self.gw_entities:
210211
members.append(item.attrib["id"])
211212

213+
group_sensors = {}
214+
group_logs = group.findall("logs")
215+
for log in group_logs:
216+
log_type = log.find("type").text
217+
measurement = log.find("period/measurement")
218+
if measurement is not None:
219+
group_sensors[log_type] = format_measure(measurement)
220+
self._count += 1
221+
212222
if group_type in GROUP_TYPES and members:
213223
groups[group_id] = {
214224
"dev_class": group_type,
215225
"model": "Group",
216226
"name": group_name,
217227
"members": members,
228+
"sensors": group_sensors,
218229
"vendor": "Plugwise",
219230
}
220231
self._count += 5

0 commit comments

Comments
 (0)