From 4deaeaeda048112c9ebd5e3883bccfcadb8dded6 Mon Sep 17 00:00:00 2001 From: G Johansson Date: Tue, 3 Dec 2024 23:08:08 +0100 Subject: [PATCH] Fix next mypy issue in airzone_cloud (#132217) --- homeassistant/components/airzone_cloud/climate.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/airzone_cloud/climate.py b/homeassistant/components/airzone_cloud/climate.py index cba41867d61..5ee15ff6819 100644 --- a/homeassistant/components/airzone_cloud/climate.py +++ b/homeassistant/components/airzone_cloud/climate.py @@ -208,8 +208,6 @@ class AirzoneClimate(AirzoneEntity, ClimateEntity): self._attr_hvac_action = HVAC_ACTION_LIB_TO_HASS[ self.get_airzone_value(AZD_ACTION) ] - if self.supported_features & ClimateEntityFeature.FAN_MODE: - self._attr_fan_mode = self._speeds.get(self.get_airzone_value(AZD_SPEED)) if self.get_airzone_value(AZD_POWER): self._attr_hvac_mode = HVAC_MODE_LIB_TO_HASS[ self.get_airzone_value(AZD_MODE) @@ -255,6 +253,13 @@ class AirzoneDeviceClimate(AirzoneClimate): ): self._initialize_fan_speeds() + @callback + def _async_update_attrs(self) -> None: + """Update climate attributes.""" + super()._async_update_attrs() + if self.supported_features & ClimateEntityFeature.FAN_MODE: + self._attr_fan_mode = self._speeds.get(self.get_airzone_value(AZD_SPEED)) + def _initialize_fan_speeds(self) -> None: """Initialize fan speeds.""" azd_speeds: dict[int, int] = self.get_airzone_value(AZD_SPEEDS)