Skip to content

Commit 9ee6cc4

Browse files
committed
Sort appl
1 parent 85cc747 commit 9ee6cc4

File tree

2 files changed

+17
-16
lines changed

2 files changed

+17
-16
lines changed

plugwise/helper.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,14 +118,14 @@ def _get_appliances(self) -> None:
118118
appl = Munch()
119119
appl.available = None
120120
appl.entity_id = appliance.get("id")
121+
appl.firmware = None
122+
appl.hardware = None
121123
appl.location = None
122-
appl.name = appliance.find("name").text
124+
appl.mac = None
123125
appl.model = None
124126
appl.model_id = None
125127
appl.module_id = None
126-
appl.firmware = None
127-
appl.hardware = None
128-
appl.mac = None
128+
appl.name = appliance.find("name").text
129129
appl.pwclass = appliance.find("type").text
130130
appl.zigbee_mac = None
131131
appl.vendor_name = None

plugwise/legacy/helper.py

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -99,32 +99,33 @@ def _get_appliances(self) -> None:
9999
for appliance in self._appliances.findall("./appliance"):
100100
appl = Munch()
101101
appl.pwclass = appliance.find("type").text
102+
103+
appl.available = None
104+
appl.entity_id = appliance.get("id")
105+
appl.firmware = None
106+
appl.hardware = None
107+
appl.location = self._home_loc_id
108+
appl.mac = None
109+
appl.model = appl.pwclass.replace("_", " ").title()
110+
appl.model_id = None
111+
appl.name = appliance.find("name").text
112+
appl.vendor_name = None
113+
appl.zigbee_mac = None
114+
102115
# Skip thermostats that have this key, should be an orphaned device (Core #81712)
103116
if (
104117
appl.pwclass == "thermostat"
105118
and appliance.find("actuator_functionalities/") is None
106119
):
107120
continue # pragma: no cover
108121

109-
appl.location = self._home_loc_id
110-
appl.entity_id = appliance.get("id")
111-
appl.name = appliance.find("name").text
112122
# Extend device_class name when a Circle/Stealth is type heater_central -- Pw-Beta Issue #739
113123
if (
114124
appl.pwclass == "heater_central"
115125
and appl.name != "Central heating boiler"
116126
):
117127
appl.pwclass = "heater_central_plug"
118128

119-
appl.model = appl.pwclass.replace("_", " ").title()
120-
appl.available = None
121-
appl.model_id = None
122-
appl.firmware = None
123-
appl.hardware = None
124-
appl.mac = None
125-
appl.zigbee_mac = None
126-
appl.vendor_name = None
127-
128129
# Determine class for this appliance
129130
# Skip on heater_central when no active device present or on orphaned stretch devices
130131
if not (appl := self._appliance_info_finder(appliance, appl)):

0 commit comments

Comments
 (0)