Skip to content

Commit 46a119b

Browse files
committed
Collect device-id's for thermostats with offset_functionality
1 parent 05ef2c3 commit 46a119b

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

plugwise/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,10 @@ def get_all_devices(self) -> None:
129129
if search.find(locator_2) is not None:
130130
self._elga = True
131131

132+
self.therms_with_offset_func = (
133+
self._get_appliances_with_offset_functionality()
134+
)
135+
132136
# Gather all the device and initial data
133137
self._scan_thermostats()
134138

plugwise/helper.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,7 @@ def __init__(self) -> None:
378378
self.smile_type: str
379379
self.smile_version: tuple[str, semver.version.Version]
380380
self.smile_zigbee_mac_address: str | None = None
381+
self.therms_with_offset_func: list[str] = []
381382

382383
def _all_locations(self) -> None:
383384
"""Collect all locations."""
@@ -906,6 +907,18 @@ def _wireless_availablity(self, appliance: etree, data: DeviceData) -> None:
906907
if module_data["reachable"] is not None:
907908
data["available"] = module_data["reachable"]
908909

910+
def _get_appliances_with_offset_functionality(self) -> list[str]:
911+
"""Helper-function collecting all appliance that have offset_functionality."""
912+
therm_list: list[str] = []
913+
offset_appls = self._appliances.findall(
914+
'.//actuator_functionalities/offset_functionality[type="temperature_offset"]/offset/..'
915+
)
916+
for item in offset_appls:
917+
therm_list.append(item.attrib["id"])
918+
919+
if therm_list:
920+
return therm_list
921+
909922
def _get_actuator_functionalities(self, xml: etree, data: DeviceData) -> None:
910923
"""Helper-function for _get_appliance_data()."""
911924
for item in ACTIVE_ACTUATORS:

0 commit comments

Comments
 (0)