Fix mypy issue in airzone cloud (#132208)

This commit is contained in:
G Johansson 2024-12-03 22:25:29 +01:00 committed by GitHub
parent f31ff3ca14
commit 14897f921c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -194,12 +194,6 @@ class AirzoneClimate(AirzoneEntity, ClimateEntity):
ClimateEntityFeature.TARGET_TEMPERATURE_RANGE 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 @callback
def _handle_coordinator_update(self) -> None: def _handle_coordinator_update(self) -> None:
"""Update attributes when the coordinator updates.""" """Update attributes when the coordinator updates."""
@ -252,6 +246,15 @@ class AirzoneDeviceClimate(AirzoneClimate):
_speeds: dict[int, str] _speeds: dict[int, str]
_speeds_reverse: dict[str, int] _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: def _initialize_fan_speeds(self) -> None:
"""Initialize fan speeds.""" """Initialize fan speeds."""
azd_speeds: dict[int, int] = self.get_airzone_value(AZD_SPEEDS) azd_speeds: dict[int, int] = self.get_airzone_value(AZD_SPEEDS)