Use _attr_supported_features in nest climate ()

pull/82261/head
epenet 2022-11-17 13:03:50 +01:00 committed by GitHub
parent ae181a47fd
commit 44b28d67f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 8 deletions
homeassistant/components/nest/legacy

View File

@ -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."""