Add ClimateEntityFeatures to Nest (#109417)

This commit is contained in:
G Johansson
2024-02-03 14:37:39 +01:00
committed by Franck Nijhof
parent cd884de79e
commit f01f033b3f
+2 -1
View File
@@ -100,6 +100,7 @@ class ThermostatEntity(ClimateEntity):
_attr_has_entity_name = True
_attr_should_poll = False
_attr_name = None
_enable_turn_on_off_backwards_compatibility = False
def __init__(self, device: Device) -> None:
"""Initialize ThermostatEntity."""
@@ -246,7 +247,7 @@ class ThermostatEntity(ClimateEntity):
def _get_supported_features(self) -> ClimateEntityFeature:
"""Compute the bitmap of supported features from the current state."""
features = ClimateEntityFeature(0)
features = ClimateEntityFeature.TURN_OFF | ClimateEntityFeature.TURN_ON
if HVACMode.HEAT_COOL in self.hvac_modes:
features |= ClimateEntityFeature.TARGET_TEMPERATURE_RANGE
if HVACMode.HEAT in self.hvac_modes or HVACMode.COOL in self.hvac_modes: