@@ -83,10 +83,10 @@ def item_count(self) -> int:
8383 """Return the item-count."""
8484 return self ._count
8585
86- def _all_appliances (self ) -> None :
86+ def _get_appliances (self ) -> None :
8787 """Collect all appliances with relevant info."""
8888 self ._count = 0
89- self ._all_locations ()
89+ self ._get_locations ()
9090
9191 self ._create_legacy_gateway ()
9292 # For legacy P1 collect the connected SmartMeter info
@@ -99,32 +99,33 @@ def _all_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 )):
@@ -137,7 +138,7 @@ def _all_appliances(self) -> None:
137138 self ._create_gw_entities (appl )
138139 self ._reorder_devices ()
139140
140- def _all_locations (self ) -> None :
141+ def _get_locations (self ) -> None :
141142 """Collect all locations."""
142143 loc = Munch ()
143144
0 commit comments