2121from .constants import (
2222 ACTIVE_ACTUATORS ,
2323 ACTUATOR_CLASSES ,
24+ ADAM ,
25+ ANNA ,
2426 APPLIANCES ,
2527 ATTR_NAME ,
2628 ATTR_UNIT_OF_MEASUREMENT ,
@@ -380,7 +382,7 @@ def _energy_device_info_finder(self, appliance: etree, appl: Munch) -> Munch | N
380382
381383 return appl
382384
383- if self .smile_name == "Adam" :
385+ if self .smile_name == ADAM :
384386 locator = "./logs/interval_log/electricity_interval_meter"
385387 mod_type = "electricity_interval_meter"
386388 module_data = self ._get_module_data (appliance , locator , mod_type )
@@ -411,7 +413,7 @@ def _appliance_info_finder(self, appliance: etree, appl: Munch) -> Munch:
411413 appl .vendor_name = "Plugwise"
412414
413415 # Adam: look for the ZigBee MAC address of the Smile
414- if self .smile_name == "Adam" and (
416+ if self .smile_name == ADAM and (
415417 found := self ._modules .find (".//protocols/zig_bee_coordinator" )
416418 ):
417419 appl .zigbee_mac = found .find ("mac_address" ).text
@@ -830,7 +832,7 @@ def _wireless_availablity(self, appliance: etree, data: DeviceData) -> None:
830832
831833 Collect the availablity-status for wireless connected devices.
832834 """
833- if self .smile_name == "Adam" :
835+ if self .smile_name == ADAM :
834836 # Collect for Plugs
835837 locator = "./logs/interval_log/electricity_interval_meter"
836838 mod_type = "electricity_interval_meter"
@@ -951,11 +953,11 @@ def _process_c_heating_state(self, data: DeviceData) -> None:
951953 if self ._on_off_device :
952954 # Anna + OnOff heater: use central_heating_state to show heating_state
953955 # Solution for Core issue #81839
954- if self .smile_name == "Smile Anna" :
956+ if self .smile_name == ANNA :
955957 data ["binary_sensors" ]["heating_state" ] = data ["c_heating_state" ]
956958
957959 # Adam + OnOff cooling: use central_heating_state to show heating/cooling_state
958- if self .smile_name == "Adam" :
960+ if self .smile_name == ADAM :
959961 if "heating_state" not in data ["binary_sensors" ]:
960962 self ._count += 1
961963 data ["binary_sensors" ]["heating_state" ] = False
@@ -1009,7 +1011,7 @@ def _get_measurement_data(self, dev_id: str) -> DeviceData:
10091011 # Collect availability-status for wireless connected devices to Adam
10101012 self ._wireless_availablity (appliance , data )
10111013
1012- if dev_id == self .gateway_id and self .smile_name == "Adam" :
1014+ if dev_id == self .gateway_id and self .smile_name == ADAM :
10131015 self ._get_regulation_mode (appliance , data )
10141016
10151017 if "c_heating_state" in data :
@@ -1020,7 +1022,7 @@ def _get_measurement_data(self, dev_id: str) -> DeviceData:
10201022
10211023 if (
10221024 self ._is_thermostat
1023- and self .smile_name == "Smile Anna"
1025+ and self .smile_name == ANNA
10241026 and dev_id == self ._heater_id
10251027 ):
10261028 # Anna+Elga: base cooling_state on the elga-status-code
@@ -1140,7 +1142,7 @@ def _get_group_switches(self) -> dict[str, DeviceData]:
11401142 """
11411143 switch_groups : dict [str , DeviceData ] = {}
11421144 # P1 and Anna don't have switchgroups
1143- if self .smile_type == "power" or self .smile_name == "Smile Anna" :
1145+ if self .smile_type == "power" or self .smile_name == ANNA :
11441146 return switch_groups
11451147
11461148 for group in self ._domain_objects .findall ("./group" ):
0 commit comments