@@ -404,10 +404,10 @@ def _appliance_info_finder(self, appl: Munch, appliance: etree) -> Munch:
404404 return self ._appl_thermostat_info (appl , appliance )
405405 case "heater_central" :
406406 # Collect heater_central device info
407- self ._appl_heater_central_info (
408- appl , appliance , False
409- ) # False means non-legacy device
410- self . _appl_dhw_mode_info ( appl , appliance )
407+ self ._appl_heater_central_info (appl , appliance , False ) # False means non-legacy device
408+ self . _dhw_allowed_modes = self . _get_appl_actuator_modes (
409+ appliance , "domestic_hot_water_mode_control_functionality"
410+ )
411411 # Skip orphaned heater_central (Core Issue #104433)
412412 if appl .entity_id != self ._heater_id :
413413 return Munch ()
@@ -450,7 +450,9 @@ def _appl_gateway_info(self, appl: Munch, appliance: etree) -> Munch:
450450 appl .zigbee_mac = found .find ("mac_address" ).text
451451
452452 # Also, collect regulation_modes and check for cooling, indicating cooling-mode is present
453- self ._appl_regulation_mode_info (appliance )
453+ self ._reg_allowed_modes = self ._get_appl_actuator_modes (
454+ appliance , "regulation_mode_control_functionality"
455+ )
454456
455457 # Finally, collect the gateway_modes
456458 self ._gw_allowed_modes = []
@@ -461,36 +463,18 @@ def _appl_gateway_info(self, appl: Munch, appliance: etree) -> Munch:
461463
462464 return appl
463465
464- def _appl_actuator_modes ()
465-
466- def _appl_regulation_mode_info (self , appliance : etree ) -> None :
466+ def _get_appl_actuator_modes (self , appliance : etree , actuator_type : str ) -> list [str ]:
467467 """Helper-function for _appliance_info_finder()."""
468- reg_mode_list : list [str ] = []
469- if (search := search_actuator_functionalities (
470- appliance , "regulation_mode_control_functionality"
471- )) is not None :
468+ mode_list : list [str ] = []
469+ if (search := search_actuator_functionalities (appliance , actuator_type )) is not None :
472470 if (modes := search .find ("allowed_modes" )) is not None :
473471 for mode in modes :
474- reg_mode_list .append (mode .text )
472+ mode_list .append (mode .text )
473+ # Collect cooling_present state from the available regulation_modes
475474 if mode .text == "cooling" :
476475 self ._cooling_present = True
477- self ._reg_allowed_modes = reg_mode_list
478-
479- def _appl_dhw_mode_info (self , appl : Munch , appliance : etree ) -> Munch :
480- """Helper-function for _appliance_info_finder().
481476
482- Collect dhw control operation modes - Anna + Loria.
483- """
484- dhw_mode_list : list [str ] = []
485- if (search := search_actuator_functionalities (
486- appliance , "domestic_hot_water_mode_control_functionality"
487- )) is not None :
488- if (modes := search .find ("allowed_modes" )) is not None :
489- for mode in modes :
490- dhw_mode_list .append (mode .text )
491- self ._dhw_allowed_modes = dhw_mode_list
492-
493- return appl
477+ return mode_list
494478
495479 def _get_appliances_with_offset_functionality (self ) -> list [str ]:
496480 """Helper-function collecting all appliance that have offset_functionality."""
0 commit comments