File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change 5757from packaging import version
5858
5959
60+ def extend_plug_device_class (appl : Munch , appliance : etree .Element ) -> None :
61+ """Extend device_class name of Plugs (Plugwise and Aqara) - Pw-Beta Issue #739."""
62+ description = appliance .find ("description" ).text
63+ if description is not None and (
64+ "ZigBee protocol" in description or "smart plug" in description
65+ ):
66+ appl .pwclass = f"{ appl .pwclass } _plug"
67+
68+
6069def search_actuator_functionalities (
6170 appliance : etree .Element , actuator : str
6271) -> etree .Element | None :
@@ -138,12 +147,7 @@ def _get_appliances(self) -> None:
138147 if appl .pwclass in THERMOSTAT_CLASSES and appl .location is None :
139148 continue
140149
141- # Extend device_class name of Plugs (Plugwise and Aqara) - Pw-Beta Issue #739
142- description = appliance .find ("description" ).text
143- if description is not None and (
144- "ZigBee protocol" in description or "smart plug" in description
145- ):
146- appl .pwclass = f"{ appl .pwclass } _plug"
150+ extend_plug_device_class (appl , appliance )
147151
148152 # Collect appliance info, skip orphaned/removed devices
149153 if not (appl := self ._appliance_info_finder (appl , appliance )):
You can’t perform that action at this time.
0 commit comments