diff --git a/homeassistant/components/airzone/climate.py b/homeassistant/components/airzone/climate.py index adbc6e1ff6e..22172255b9b 100644 --- a/homeassistant/components/airzone/climate.py +++ b/homeassistant/components/airzone/climate.py @@ -31,6 +31,7 @@ from aioairzone.const import ( ) from homeassistant.components.climate import ( + ATTR_HVAC_MODE, ATTR_TARGET_TEMP_HIGH, ATTR_TARGET_TEMP_LOW, FAN_AUTO, @@ -222,6 +223,9 @@ class AirzoneClimate(AirzoneZoneEntity, ClimateEntity): params[API_HEAT_SET_POINT] = kwargs[ATTR_TARGET_TEMP_LOW] await self._async_update_hvac_params(params) + if ATTR_HVAC_MODE in kwargs: + await self.async_set_hvac_mode(kwargs[ATTR_HVAC_MODE]) + @callback def _handle_coordinator_update(self) -> None: """Update attributes when the coordinator updates.""" diff --git a/tests/components/airzone/test_climate.py b/tests/components/airzone/test_climate.py index 94bea0a5e07..34844e34370 100644 --- a/tests/components/airzone/test_climate.py +++ b/tests/components/airzone/test_climate.py @@ -536,6 +536,7 @@ async def test_airzone_climate_set_temp(hass: HomeAssistant) -> None: API_SYSTEM_ID: 1, API_ZONE_ID: 5, API_SET_POINT: 20.5, + API_ON: 1, } ] } @@ -551,12 +552,14 @@ async def test_airzone_climate_set_temp(hass: HomeAssistant) -> None: SERVICE_SET_TEMPERATURE, { ATTR_ENTITY_ID: "climate.dorm_2", + ATTR_HVAC_MODE: HVACMode.HEAT, ATTR_TEMPERATURE: 20.5, }, blocking=True, ) state = hass.states.get("climate.dorm_2") + assert state.state == HVACMode.HEAT assert state.attributes.get(ATTR_TEMPERATURE) == 20.5