Use _attr_supported_features in tado climate (#82219)

pull/82222/head
epenet 2022-11-16 20:52:36 +01:00 committed by GitHub
parent ba546e1072
commit c62c19e58b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 9 deletions

View File

@ -245,7 +245,7 @@ class TadoClimate(TadoZoneEntity, ClimateEntity):
self._ac_device = zone_type == TYPE_AIR_CONDITIONING
self._supported_hvac_modes = supported_hvac_modes
self._supported_fan_modes = supported_fan_modes
self._support_flags = support_flags
self._attr_supported_features = support_flags
self._available = False
@ -286,11 +286,6 @@ class TadoClimate(TadoZoneEntity, ClimateEntity):
)
)
@property
def supported_features(self):
"""Return the list of supported features."""
return self._support_flags
@property
def name(self):
"""Return the name of the entity."""
@ -466,7 +461,7 @@ class TadoClimate(TadoZoneEntity, ClimateEntity):
@property
def swing_modes(self):
"""Swing modes for the device."""
if self._support_flags & ClimateEntityFeature.SWING_MODE:
if self.supported_features & ClimateEntityFeature.SWING_MODE:
return [TADO_SWING_ON, TADO_SWING_OFF]
return None
@ -618,10 +613,10 @@ class TadoClimate(TadoZoneEntity, ClimateEntity):
temperature_to_send = None
fan_speed = None
if self._support_flags & ClimateEntityFeature.FAN_MODE:
if self.supported_features & ClimateEntityFeature.FAN_MODE:
fan_speed = self._current_tado_fan_speed
swing = None
if self._support_flags & ClimateEntityFeature.SWING_MODE:
if self.supported_features & ClimateEntityFeature.SWING_MODE:
swing = self._current_tado_swing_mode
self._tado.set_zone_overlay(