Skip to content

Commit d2e0808

Browse files
committed
Implement heater_cental filtering for legacy
1 parent f9d27d6 commit d2e0808

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

plugwise/legacy/helper.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,13 @@ def _all_appliances(self) -> None:
116116
appl.location = self._home_location
117117
appl.dev_id = appliance.attrib["id"]
118118
appl.name = appliance.find("name").text
119+
# Extend device_class name when a Cirlce/Stealth has the type heater_central
120+
if (
121+
appl.pwclass == "heater_central"
122+
and appl.name != "Central heating boiler"
123+
):
124+
appl.pwclass == "heater_central_plug"
125+
119126
appl.model = appl.pwclass.replace("_", " ").title()
120127
appl.model_id = None
121128
appl.firmware = None

plugwise/util.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,9 @@ def check_heater_central(xml: etree) -> str:
9191
has_actuators: bool = (
9292
heater_central.find("actuator_functionalities/") is not None
9393
)
94-
# Filter Plug configured as heater_central type
95-
hc_desc: str = heater_central.find("description").text
96-
if hc_desc is None or (
97-
"ZigBee protocol" not in hc_desc and "smart plug" not in hc_desc
98-
):
94+
# Filter for Plug/Circle/Stealth heater_central
95+
hc_name = heater_central.find("name").text
96+
if hc_name == "Central heating boiler":
9997
hc_list.append({hc_id: has_actuators})
10098

10199
heater_central_id = list(hc_list[0].keys())[0]

0 commit comments

Comments
 (0)