diff --git a/custom_components/yandex_station/climate.py b/custom_components/yandex_station/climate.py index bdbdca7..4090919 100644 --- a/custom_components/yandex_station/climate.py +++ b/custom_components/yandex_station/climate.py @@ -5,7 +5,7 @@ ClimateEntityFeature, HVACMode, ) -from homeassistant.const import UnitOfTemperature +from homeassistant.const import MAJOR_VERSION, MINOR_VERSION, UnitOfTemperature from .core import utils from .core.entity import YandexEntity @@ -43,6 +43,13 @@ class YandexClimate(ClimateEntity, YandexEntity): on_value: bool = None hvac_value: str = None + # https://developers.home-assistant.io/blog/2024/01/24/climate-climateentityfeatures-expanded + if (MAJOR_VERSION, MINOR_VERSION) >= (2024, 2): + _attr_supported_features = ( + ClimateEntityFeature.TURN_ON | ClimateEntityFeature.TURN_OFF + ) + _enable_turn_on_off_backwards_compatibility = False + def internal_init(self, capabilities: dict, properties: dict): # instance candidates for hvac and preset modes candidates = ["thermostat", "program", "heat", "work_speed"]