Skip to content

Commit 34f2631

Browse files
committed
_all_appliances(): reorder code, all checks first
1 parent f52f0c5 commit 34f2631

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

plugwise/helper.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,6 @@ def _all_appliances(self) -> None:
109109
if appl.pwclass == "open_therm_gateway":
110110
continue
111111

112-
# Extend device_class name of Plugs (Plugwise and Aqara) - Pw-Beta Issue #739
113-
description = appliance.find("description").text
114-
if description is not None and (
115-
"ZigBee protocol" in description or "smart plug" in description
116-
):
117-
appl.pwclass = f"{appl.pwclass}_plug"
118-
119112
# Skip thermostats that have this key, should be an orphaned device (Core #81712)
120113
if (
121114
appl.pwclass == "thermostat"
@@ -146,7 +139,14 @@ def _all_appliances(self) -> None:
146139
appl.zigbee_mac = None
147140
appl.vendor_name = None
148141

142+
# Extend device_class name of Plugs (Plugwise and Aqara) - Pw-Beta Issue #739
143+
description = appliance.find("description").text
144+
if description is not None and (
145+
"ZigBee protocol" in description or "smart plug" in description
146+
):
147+
appl.pwclass = f"{appl.pwclass}_plug"
149148
# Collect appliance info, skip orphaned/removed devices
149+
150150
if not (appl := self._appliance_info_finder(appl, appliance)):
151151
continue
152152

0 commit comments

Comments
 (0)