diff --git a/homeassistant/components/overkiz/climate_entities/atlantic_electrical_heater.py b/homeassistant/components/overkiz/climate_entities/atlantic_electrical_heater.py index 2558c7e8e8e..0a397e9f2ad 100644 --- a/homeassistant/components/overkiz/climate_entities/atlantic_electrical_heater.py +++ b/homeassistant/components/overkiz/climate_entities/atlantic_electrical_heater.py @@ -5,26 +5,23 @@ from typing import cast from pyoverkiz.enums import OverkizCommand, OverkizCommandParam, OverkizState -from homeassistant.components.climate import ( - HVAC_MODE_OFF, - ClimateEntity, - ClimateEntityFeature, -) +from homeassistant.components.climate import ClimateEntity from homeassistant.components.climate.const import ( - HVAC_MODE_HEAT, PRESET_COMFORT, PRESET_ECO, PRESET_NONE, + ClimateEntityFeature, + HVACMode, ) from homeassistant.components.overkiz.entity import OverkizEntity from homeassistant.const import TEMP_CELSIUS PRESET_FROST_PROTECTION = "frost_protection" -OVERKIZ_TO_HVAC_MODES: dict[str, str] = { - OverkizCommandParam.ON: HVAC_MODE_HEAT, - OverkizCommandParam.COMFORT: HVAC_MODE_HEAT, - OverkizCommandParam.OFF: HVAC_MODE_OFF, +OVERKIZ_TO_HVAC_MODES: dict[str, HVACMode] = { + OverkizCommandParam.ON: HVACMode.HEAT, + OverkizCommandParam.COMFORT: HVACMode.HEAT, + OverkizCommandParam.OFF: HVACMode.OFF, } HVAC_MODES_TO_OVERKIZ = {v: k for k, v in OVERKIZ_TO_HVAC_MODES.items()} @@ -47,13 +44,13 @@ class AtlanticElectricalHeater(OverkizEntity, ClimateEntity): _attr_temperature_unit = TEMP_CELSIUS @property - def hvac_mode(self) -> str: + def hvac_mode(self) -> HVACMode: """Return hvac operation ie. heat, cool mode.""" return OVERKIZ_TO_HVAC_MODES[ cast(str, self.executor.select_state(OverkizState.CORE_ON_OFF)) ] - async def async_set_hvac_mode(self, hvac_mode: str) -> None: + async def async_set_hvac_mode(self, hvac_mode: HVACMode) -> None: """Set new target hvac mode.""" await self.executor.async_execute_command( OverkizCommand.SET_HEATING_LEVEL, HVAC_MODES_TO_OVERKIZ[hvac_mode]