@@ -349,14 +349,14 @@ def _get_module_data(
349349 model_data ["hardware_version" ] = module .find ("hardware_version" ).text
350350 model_data ["firmware_version" ] = module .find ("firmware_version" ).text
351351 # Adam
352- if zb_node := module .find ("./protocols/zig_bee_node" ):
352+ if ( zb_node := module .find ("./protocols/zig_bee_node" )) is not None :
353353 model_data ["zigbee_mac_address" ] = zb_node .find ("mac_address" ).text
354354 model_data ["reachable" ] = zb_node .find ("reachable" ).text == "true"
355355 # Stretches
356- if router := module .find ("./protocols/network_router" ):
356+ if ( router := module .find ("./protocols/network_router" )) is not None :
357357 model_data ["zigbee_mac_address" ] = router .find ("mac_address" ).text
358358 # Also look for the Circle+/Stealth M+
359- if coord := module .find ("./protocols/network_coordinator" ):
359+ if ( coord := module .find ("./protocols/network_coordinator" )) is not None :
360360 model_data ["zigbee_mac_address" ] = coord .find ("mac_address" ).text
361361
362362 return model_data
@@ -420,7 +420,7 @@ def _appliance_info_finder(self, appliance: etree, appl: Munch) -> Munch:
420420
421421 # Adam: look for the ZigBee MAC address of the Smile
422422 if self .smile (ADAM ) and (
423- found := self ._modules .find (".//protocols/zig_bee_coordinator" )
423+ ( found := self ._modules .find (".//protocols/zig_bee_coordinator" )) is not None
424424 ):
425425 appl .zigbee_mac = found .find ("mac_address" ).text
426426
@@ -1490,7 +1490,7 @@ def _schedules(self, location: str) -> tuple[list[str], str]:
14901490 name = self ._domain_objects .find (f'./rule[@id="{ rule_id } "]/name' ).text
14911491 locator = f'./rule[@id="{ rule_id } "]/directives'
14921492 # Show an empty schedule as no schedule found
1493- if not self ._domain_objects .find (locator ):
1493+ if self ._domain_objects .find (locator ) is None :
14941494 continue # pragma: no cover
14951495
14961496 available .append (name )
0 commit comments