Use _attr_supported_features in nest climate (#82217)
parent
ae181a47fd
commit
44b28d67f1
homeassistant/components/nest/legacy
|
@ -97,7 +97,7 @@ class NestThermostat(ClimateEntity):
|
|||
self._fan_modes = [FAN_ON, FAN_AUTO]
|
||||
|
||||
# Set the default supported features
|
||||
self._support_flags = (
|
||||
self._attr_supported_features = (
|
||||
ClimateEntityFeature.TARGET_TEMPERATURE | ClimateEntityFeature.PRESET_MODE
|
||||
)
|
||||
|
||||
|
@ -106,7 +106,9 @@ class NestThermostat(ClimateEntity):
|
|||
|
||||
if self.device.can_heat and self.device.can_cool:
|
||||
self._operation_list.append(HVACMode.AUTO)
|
||||
self._support_flags |= ClimateEntityFeature.TARGET_TEMPERATURE_RANGE
|
||||
self._attr_supported_features |= (
|
||||
ClimateEntityFeature.TARGET_TEMPERATURE_RANGE
|
||||
)
|
||||
|
||||
# Add supported nest thermostat features
|
||||
if self.device.can_heat:
|
||||
|
@ -120,7 +122,7 @@ class NestThermostat(ClimateEntity):
|
|||
# feature of device
|
||||
self._has_fan = self.device.has_fan
|
||||
if self._has_fan:
|
||||
self._support_flags |= ClimateEntityFeature.FAN_MODE
|
||||
self._attr_supported_features |= ClimateEntityFeature.FAN_MODE
|
||||
|
||||
# data attributes
|
||||
self._away = None
|
||||
|
@ -150,11 +152,6 @@ class NestThermostat(ClimateEntity):
|
|||
async_dispatcher_connect(self.hass, SIGNAL_NEST_UPDATE, async_update_state)
|
||||
)
|
||||
|
||||
@property
|
||||
def supported_features(self):
|
||||
"""Return the list of supported features."""
|
||||
return self._support_flags
|
||||
|
||||
@property
|
||||
def unique_id(self):
|
||||
"""Return unique ID for this device."""
|
||||
|
|
Loading…
Reference in New Issue