@@ -54,10 +54,6 @@ class SmileData(SmileHelper):
5454
5555 def update_for_cooling (self , device : DeviceData ) -> DeviceData :
5656 """Helper-function for adding/updating various cooling-related values."""
57- # Add setpoint_low and setpoint_high when cooling is enabled
58- if device ["dev_class" ] not in ZONE_THERMOSTATS :
59- return device
60-
6157 # For heating + cooling, replace setpoint with setpoint_high/_low
6258 if self ._cooling_present :
6359 thermostat = device ["thermostat" ]
@@ -85,7 +81,7 @@ def update_for_cooling(self, device: DeviceData) -> DeviceData:
8581 sensors ["setpoint_low" ] = temp_dict ["setpoint_low" ]
8682 sensors ["setpoint_high" ] = temp_dict ["setpoint_high" ]
8783
88- return device
84+ return device
8985
9086 def _all_device_data (self ) -> None :
9187 """Helper-function for get_all_devices().
@@ -102,7 +98,8 @@ def _all_device_data(self) -> None:
10298 )
10399
104100 # Update for cooling
105- self .update_for_cooling (self .gw_devices [device_id ])
101+ if self .gw_devices [device_id ]["dev_class" ] in ZONE_THERMOSTATS :
102+ self .update_for_cooling (self .gw_devices [device_id ])
106103
107104 self .gw_data .update (
108105 {"smile_name" : self .smile_name , "gateway_id" : self .gateway_id }
@@ -551,7 +548,8 @@ async def async_update(self) -> PlugwiseData:
551548 )
552549
553550 # Update for cooling
554- self .update_for_cooling (dev_dict )
551+ if dev_dict ["dev_class" ] in ZONE_THERMOSTATS :
552+ self .update_for_cooling (dev_dict )
555553
556554 return PlugwiseData (self .gw_data , self .gw_devices )
557555
0 commit comments