@@ -940,12 +940,12 @@ def _cleanup_data(self, data: dict[str, Any]) -> None:
940940 if "temperature" in data :
941941 data .pop ("heating_state" , None )
942942
943- # Don't show cooling-related when no cooling present
943+ # Don't show cooling-related when no cooling present,
944+ # but, keep cooling_enabled for Elga
944945 if not self ._cooling_present :
945946 for item in ("cooling_state" , "cooling_ena_switch" ):
946947 if item in data :
947948 data .pop (item )
948- # Keep cooling_enabled for Elga
949949 if not self ._elga and "cooling_enabled" in data :
950950 data .pop ("cooling_enabled" ) # pragma: no cover
951951
@@ -960,14 +960,18 @@ def _process_c_heating_state(self, data: dict[str, Any]) -> None:
960960 if self .smile_name == "Smile Anna" :
961961 data ["heating_state" ] = data ["c_heating_state" ]
962962
963+ # Adam + OnOff cooling: use central_heating_state to show heating/cooling_state
963964 if self .smile_name == "Adam" :
964- data ["heating_state" ] = False
965- # Adam + OnOff cooling: use central_heating_state to show heating/cooling_state
965+ data ["cooling_state" ] = data ["heating_state" ] = False
966966 if self ._cooling_enabled :
967967 data ["cooling_state" ] = data ["c_heating_state" ]
968968 else :
969969 data ["heating_state" ] = data ["c_heating_state" ]
970970
971+ # Anna + Elga: use central_heating_state to show heating_state
972+ if self ._elga :
973+ data ["heating_state" ] = data ["c_heating_state" ]
974+
971975 def _get_appliance_data (self , d_id : str ) -> DeviceData :
972976 """Helper-function for smile.py: _get_device_data().
973977
@@ -1007,17 +1011,11 @@ def _get_appliance_data(self, d_id: str) -> DeviceData:
10071011 data .pop ("c_heating_state" )
10081012
10091013 if d_id == self ._heater_id and self .smile_name == "Smile Anna" :
1014+ # Anna+Elga: base cooling_state on the elga-status-code
10101015 if "elga_status_code" in data :
1011- # Base heating_/cooling_state on the elga-status-code
1012- data ["heating_state" ] = False
1013- data ["cooling_state" ] = False
1014- if data ["elga_status_code" ] in [4 , 10 ] or (
1015- data ["elga_status_code" ] in [3 , 5 , 6 , 11 ] and not data ["dhw_state" ]
1016- ):
1017- data ["heating_state" ] = True
1018- if data ["elga_status_code" ] == 8 :
1019- data ["cooling_state" ] = self ._cooling_active = True
1020-
1016+ data ["cooling_state" ] = self ._cooling_active = (
1017+ data ["elga_status_code" ] == 8
1018+ )
10211019 data .pop ("elga_status_code" , None )
10221020
10231021 # Determine _cooling_present and _cooling_enabled
@@ -1028,8 +1026,10 @@ def _get_appliance_data(self, d_id: str) -> DeviceData:
10281026 # Elga has no cooling-switch
10291027 if "cooling_ena_switch" in data :
10301028 data .pop ("cooling_ena_switch" )
1029+
1030+ # Loria/Thermastage: cooling-related is based on cooling_state
1031+ # and modulation_level
10311032 else :
1032- # Loria/Thermastage: cooling-related is based on cooling_state and modulation_level
10331033 if self ._cooling_present and "cooling_state" in data :
10341034 self ._cooling_enabled = data ["cooling_state" ]
10351035 self ._cooling_active = data ["modulation_level" ] == 100
0 commit comments