From af509988225ad5b114e8cb4535a3f94475e2b035 Mon Sep 17 00:00:00 2001 From: Ryazanov Alexander Mihailovich Date: Wed, 10 Apr 2024 15:38:16 +0300 Subject: [PATCH] fix: add turn_on/turn_iff features to climate entity --- custom_components/turkov/climate.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/custom_components/turkov/climate.py b/custom_components/turkov/climate.py index a09e3b7..d1898da 100644 --- a/custom_components/turkov/climate.py +++ b/custom_components/turkov/climate.py @@ -79,6 +79,12 @@ def _update_attr_supported_features(self) -> None: device = self.coordinator.turkov_device supported_features = ClimateEntityFeature.FAN_MODE + for feature_name in ("TURN_ON", "TURN_OFF"): + # @todo: check against latest HA support + if hasattr(ClimateEntityFeature, feature_name): + supported_features |= getattr( + ClimateEntityFeature, feature_name + ) if getattr(self, "_attr_supported_features", None): supported_features |= self._attr_supported_features if device.target_temperature is not None: