Skip to content

Commit

Permalink
Fix mypy issue in airzone cloud (home-assistant#132208)
Browse files Browse the repository at this point in the history
  • Loading branch information
gjohansson-ST authored Dec 3, 2024
1 parent f31ff3c commit 14897f9
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions homeassistant/components/airzone_cloud/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,12 +194,6 @@ def _init_attributes(self) -> None:
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."""
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 14897f9

Please sign in to comment.