Add new climate feature flags to generic_thermostat (#109548)

Adds new climate feature flags to generic_thermostat
pull/109601/head
G Johansson 2024-02-04 04:38:09 -05:00 committed by GitHub
parent 6b6d0606ac
commit b655507738
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 1 deletions

View File

@ -178,6 +178,7 @@ class GenericThermostat(ClimateEntity, RestoreEntity):
"""Representation of a Generic Thermostat device."""
_attr_should_poll = False
_enable_turn_on_off_backwards_compatibility = False
def __init__(
self,
@ -225,7 +226,11 @@ class GenericThermostat(ClimateEntity, RestoreEntity):
self._target_temp = target_temp
self._attr_temperature_unit = unit
self._attr_unique_id = unique_id
self._attr_supported_features = ClimateEntityFeature.TARGET_TEMPERATURE
self._attr_supported_features = (
ClimateEntityFeature.TARGET_TEMPERATURE
| ClimateEntityFeature.TURN_OFF
| ClimateEntityFeature.TURN_ON
)
if len(presets):
self._attr_supported_features |= ClimateEntityFeature.PRESET_MODE
self._attr_preset_modes = [PRESET_NONE] + list(presets.keys())