From 14897f921cd6846d7bde1f85c9b3c9f3b8a1a285 Mon Sep 17 00:00:00 2001 From: G Johansson Date: Tue, 3 Dec 2024 22:25:29 +0100 Subject: [PATCH] Fix mypy issue in airzone cloud (#132208) --- homeassistant/components/airzone_cloud/climate.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/homeassistant/components/airzone_cloud/climate.py b/homeassistant/components/airzone_cloud/climate.py index d32b070ad8c..cba41867d61 100644 --- a/homeassistant/components/airzone_cloud/climate.py +++ b/homeassistant/components/airzone_cloud/climate.py @@ -194,12 +194,6 @@ class AirzoneClimate(AirzoneEntity, ClimateEntity): ClimateEntityFeature.TARGET_TEMPERATURE_RANGE ) - if ( - self.get_airzone_value(AZD_SPEED) is not None - and self.get_airzone_value(AZD_SPEEDS) is not None - ): - self._initialize_fan_speeds() - @callback def _handle_coordinator_update(self) -> None: """Update attributes when the coordinator updates.""" @@ -252,6 +246,15 @@ class AirzoneDeviceClimate(AirzoneClimate): _speeds: dict[int, str] _speeds_reverse: dict[str, int] + def _init_attributes(self) -> None: + """Init common climate device attributes.""" + super()._init_attributes() + if ( + self.get_airzone_value(AZD_SPEED) is not None + and self.get_airzone_value(AZD_SPEEDS) is not None + ): + self._initialize_fan_speeds() + def _initialize_fan_speeds(self) -> None: """Initialize fan speeds.""" azd_speeds: dict[int, int] = self.get_airzone_value(AZD_SPEEDS)