@@ -198,7 +198,8 @@ def _get_entity_data(self, entity_id: str) -> GwEntityData:
198198 # Switching groups data
199199 self ._entity_switching_group (entity , data )
200200 # Adam data
201- self ._get_adam_data (entity , data )
201+ if self .smile (ADAM ):
202+ self ._get_adam_data (entity , data )
202203
203204 # Thermostat data for Anna (presets, temperatures etc)
204205 if self .smile (ANNA ) and entity ["dev_class" ] == "thermostat" :
@@ -225,26 +226,26 @@ def _get_adam_data(self, entity: GwEntityData, data: GwEntityData) -> None:
225226 """Helper-function for _get_entity_data().
226227
227228 Determine Adam heating-status for on-off heating via valves,
228- available regulations_modes and thermostat control_states.
229+ available regulations_modes and thermostat control_states,
230+ and add missing cooling_enabled when required.
229231 """
230- if self . smile ( ADAM ) :
232+ if entity [ "dev_class" ] == "heater_central" :
231233 # Indicate heating_state based on valves being open in case of city-provided heating
232- if (
233- entity ["dev_class" ] == "heater_central"
234- and self ._on_off_device
235- and isinstance (self ._heating_valves (), int )
236- ):
234+ if self ._on_off_device and isinstance (self ._heating_valves (), int ):
237235 data ["binary_sensors" ]["heating_state" ] = self ._heating_valves () != 0
238-
239- # Show the allowed regulation_modes and gateway_modes
240- if entity ["dev_class" ] == "gateway" :
241- if self ._reg_allowed_modes :
242- data ["regulation_modes" ] = self ._reg_allowed_modes
243- self ._count += 1
244- if self ._gw_allowed_modes :
245- data ["gateway_modes" ] = self ._gw_allowed_modes
246- self ._count += 1
247-
236+ # Add cooling_enabled binary_sensor
237+ if "binary_sensors" in data :
238+ if "cooling_enabled" not in data ["binary_sensors" ] and self ._cooling_present :
239+ data ["binary_sensors" ]["cooling_enabled" ] = self ._cooling_enabled
240+
241+ # Show the allowed regulation_modes and gateway_modes
242+ if entity ["dev_class" ] == "gateway" :
243+ if self ._reg_allowed_modes :
244+ data ["regulation_modes" ] = self ._reg_allowed_modes
245+ self ._count += 1
246+ if self ._gw_allowed_modes :
247+ data ["gateway_modes" ] = self ._gw_allowed_modes
248+ self ._count += 1
248249
249250 def _climate_data (
250251 self ,
0 commit comments