Fix evohome preset modes (#76606)

pull/76666/head
Martin Hjelmare 2022-08-11 14:53:40 +02:00 committed by GitHub
parent 66b742f110
commit 078a4974e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 14 deletions

View File

@ -128,26 +128,17 @@ class EvoClimateEntity(EvoDevice, ClimateEntity):
_attr_temperature_unit = TEMP_CELSIUS
def __init__(self, evo_broker, evo_device) -> None:
"""Initialize a Climate device."""
super().__init__(evo_broker, evo_device)
self._preset_modes = None
@property
def hvac_modes(self) -> list[str]:
"""Return a list of available hvac operation modes."""
return list(HA_HVAC_TO_TCS)
@property
def preset_modes(self) -> list[str] | None:
"""Return a list of available preset modes."""
return self._preset_modes
class EvoZone(EvoChild, EvoClimateEntity):
"""Base for a Honeywell TCC Zone."""
_attr_preset_modes = list(HA_PRESET_TO_EVO)
def __init__(self, evo_broker, evo_device) -> None:
"""Initialize a Honeywell TCC Zone."""
super().__init__(evo_broker, evo_device)
@ -233,7 +224,7 @@ class EvoZone(EvoChild, EvoClimateEntity):
"""
return self._evo_device.setpointCapabilities["maxHeatSetpoint"]
async def async_set_temperature(self, **kwargs) -> None:
async def async_set_temperature(self, **kwargs: Any) -> None:
"""Set a new target temperature."""
temperature = kwargs["temperature"]
@ -249,7 +240,7 @@ class EvoZone(EvoChild, EvoClimateEntity):
self._evo_device.set_temperature(temperature, until=until)
)
async def async_set_hvac_mode(self, hvac_mode: str) -> None:
async def async_set_hvac_mode(self, hvac_mode: HVACMode) -> None:
"""Set a Zone to one of its native EVO_* operating modes.
Zones inherit their _effective_ operating mode from their Controller.
@ -387,7 +378,7 @@ class EvoController(EvoClimateEntity):
"""Return the current preset mode, e.g., home, away, temp."""
return TCS_PRESET_TO_HA.get(self._evo_tcs.systemModeStatus["mode"])
async def async_set_temperature(self, **kwargs) -> None:
async def async_set_temperature(self, **kwargs: Any) -> None:
"""Raise exception as Controllers don't have a target temperature."""
raise NotImplementedError("Evohome Controllers don't have target temperatures.")