@@ -98,9 +98,9 @@ def _appl_heater_central_info(
9898 # xml_1: appliance
9999 # xml_3: self._modules for legacy, self._domain_objects for actual
100100 xml_3 = return_valid (xml_3 , self ._domain_objects )
101- module_data = self ._get_module_data (xml_1 , locator_1 , xml_3 )
101+ module_data = self ._get_module_data (xml_1 , locator_1 , xml_2 = xml_3 )
102102 if not module_data ["contents" ]:
103- module_data = self ._get_module_data (xml_1 , locator_2 , xml_3 )
103+ module_data = self ._get_module_data (xml_1 , locator_2 , xml_2 = xml_3 )
104104 if not module_data ["contents" ]:
105105 self ._heater_id = NONE
106106 return (
@@ -121,7 +121,7 @@ def _appl_thermostat_info(
121121 """Helper-function for _appliance_info_finder()."""
122122 locator = "./logs/point_log[type='thermostat']/thermostat"
123123 xml_2 = return_valid (xml_2 , self ._domain_objects )
124- module_data = self ._get_module_data (xml_1 , locator , xml_2 )
124+ module_data = self ._get_module_data (xml_1 , locator , xml_2 = xml_2 )
125125 if not module_data ["contents" ]:
126126 return Munch () # no module-data present means the device has been removed
127127
@@ -239,6 +239,7 @@ def _get_module_data(
239239 self ,
240240 xml_1 : etree .Element ,
241241 locator : str ,
242+ key : str | None = None ,
242243 xml_2 : etree .Element = None ,
243244 legacy : bool = False ,
244245 ) -> ModuleData :
@@ -256,8 +257,11 @@ def _get_module_data(
256257 "zigbee_mac_address" : None ,
257258 }
258259
259- if ( appl_search := xml_1 .find (locator )) is not None :
260+ for appl_search in xml_1 .findall (locator ):
260261 link_tag = appl_search .tag
262+ if key is not None and key not in link_tag :
263+ continue
264+
261265 link_id = appl_search .attrib ["id" ]
262266 loc = f".//services/{ link_tag } [@id='{ link_id } ']...."
263267 # Not possible to walrus for some reason...
@@ -272,4 +276,6 @@ def _get_module_data(
272276 module_data ["firmware_version" ] = module .find ("firmware_version" ).text
273277 get_zigbee_data (module , module_data , legacy )
274278
279+ break
280+
275281 return module_data
0 commit comments