diff --git a/homeassistant/components/melcloud/climate.py b/homeassistant/components/melcloud/climate.py index 589223dc0f3..9d2a4f08257 100644 --- a/homeassistant/components/melcloud/climate.py +++ b/homeassistant/components/melcloud/climate.py @@ -20,6 +20,7 @@ from homeassistant.components.climate import ( DEFAULT_MIN_TEMP, ClimateEntity, ClimateEntityFeature, + HVACAction, HVACMode, ) from homeassistant.config_entries import ConfigEntry @@ -60,6 +61,18 @@ ATW_ZONE_HVAC_MODE_LOOKUP = { } ATW_ZONE_HVAC_MODE_REVERSE_LOOKUP = {v: k for k, v in ATW_ZONE_HVAC_MODE_LOOKUP.items()} +ATW_ZONE_HVAC_ACTION_LOOKUP = { + atw.STATUS_IDLE: HVACAction.IDLE, + atw.STATUS_HEAT_ZONES: HVACAction.HEATING, + atw.STATUS_COOL: HVACAction.COOLING, + atw.STATUS_STANDBY: HVACAction.IDLE, + # Heating water tank, so the zone is idle + atw.STATUS_HEAT_WATER: HVACAction.IDLE, + atw.STATUS_LEGIONELLA: HVACAction.IDLE, + # Heat pump cannot heat in this mode, but will be ready soon + atw.STATUS_DEFROST: HVACAction.PREHEATING, +} + async def async_setup_entry( hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback @@ -351,6 +364,13 @@ class AtwDeviceZoneClimate(MelCloudClimate): """Return the list of available hvac operation modes.""" return [self.hvac_mode] + @property + def hvac_action(self) -> HVACAction | None: + """Return the current running hvac operation.""" + if not self._device.power: + return HVACAction.OFF + return ATW_ZONE_HVAC_ACTION_LOOKUP.get(self._device.status) + @property def current_temperature(self) -> float | None: """Return the current temperature."""