mirror of https://github.com/home-assistant/core
Remove temporary variable from supported_features (#42685)
* Remove temporary variable from supported_features * Revert removing temp variable for supported features hunterdouglas
This commit is contained in:
parent
b45fa29077
commit
a7bd521768
|
@ -68,10 +68,9 @@ class AdsLight(AdsEntity, LightEntity):
|
|||
@property
|
||||
def supported_features(self):
|
||||
"""Flag supported features."""
|
||||
support = 0
|
||||
if self._ads_var_brightness is not None:
|
||||
support = SUPPORT_BRIGHTNESS
|
||||
return support
|
||||
return SUPPORT_BRIGHTNESS
|
||||
return 0
|
||||
|
||||
@property
|
||||
def is_on(self):
|
||||
|
|
|
@ -68,11 +68,9 @@ class BondLight(BondEntity, LightEntity):
|
|||
@property
|
||||
def supported_features(self) -> Optional[int]:
|
||||
"""Flag supported features."""
|
||||
features = 0
|
||||
if self._device.supports_set_brightness():
|
||||
features |= SUPPORT_BRIGHTNESS
|
||||
|
||||
return features
|
||||
return SUPPORT_BRIGHTNESS
|
||||
return 0
|
||||
|
||||
@property
|
||||
def is_on(self) -> bool:
|
||||
|
|
|
@ -187,10 +187,9 @@ class Control4Light(Control4Entity, LightEntity):
|
|||
@property
|
||||
def supported_features(self) -> int:
|
||||
"""Flag supported features."""
|
||||
flags = 0
|
||||
if self._is_dimmer:
|
||||
flags |= SUPPORT_BRIGHTNESS | SUPPORT_TRANSITION
|
||||
return flags
|
||||
return SUPPORT_BRIGHTNESS | SUPPORT_TRANSITION
|
||||
return 0
|
||||
|
||||
async def async_turn_on(self, **kwargs) -> None:
|
||||
"""Turn the entity on."""
|
||||
|
|
|
@ -71,10 +71,9 @@ class LcnOutputLight(LcnDevice, LightEntity):
|
|||
@property
|
||||
def supported_features(self):
|
||||
"""Flag supported features."""
|
||||
features = SUPPORT_TRANSITION
|
||||
if self.dimmable:
|
||||
features |= SUPPORT_BRIGHTNESS
|
||||
return features
|
||||
return SUPPORT_TRANSITION | SUPPORT_BRIGHTNESS
|
||||
return SUPPORT_TRANSITION
|
||||
|
||||
@property
|
||||
def brightness(self):
|
||||
|
|
|
@ -84,10 +84,9 @@ class NestCamera(Camera):
|
|||
@property
|
||||
def supported_features(self):
|
||||
"""Flag supported features."""
|
||||
features = 0
|
||||
if CameraLiveStreamTrait.NAME in self._device.traits:
|
||||
features = features | SUPPORT_STREAM
|
||||
return features
|
||||
return SUPPORT_STREAM
|
||||
return 0
|
||||
|
||||
async def stream_source(self):
|
||||
"""Return the source of the stream."""
|
||||
|
|
|
@ -44,12 +44,9 @@ class SpiderThermostat(ClimateEntity):
|
|||
@property
|
||||
def supported_features(self):
|
||||
"""Return the list of supported features."""
|
||||
supports = SUPPORT_TARGET_TEMPERATURE
|
||||
|
||||
if self.thermostat.has_fan_mode:
|
||||
supports |= SUPPORT_FAN_MODE
|
||||
|
||||
return supports
|
||||
return SUPPORT_TARGET_TEMPERATURE | SUPPORT_FAN_MODE
|
||||
return SUPPORT_TARGET_TEMPERATURE
|
||||
|
||||
@property
|
||||
def unique_id(self):
|
||||
|
|
|
@ -68,10 +68,9 @@ class TuyaCover(TuyaDevice, CoverEntity):
|
|||
@property
|
||||
def supported_features(self):
|
||||
"""Flag supported features."""
|
||||
supported_features = SUPPORT_OPEN | SUPPORT_CLOSE
|
||||
if self._tuya.support_stop():
|
||||
supported_features |= SUPPORT_STOP
|
||||
return supported_features
|
||||
return SUPPORT_OPEN | SUPPORT_CLOSE | SUPPORT_STOP
|
||||
return SUPPORT_OPEN | SUPPORT_CLOSE
|
||||
|
||||
@property
|
||||
def is_opening(self):
|
||||
|
|
|
@ -119,7 +119,6 @@ class TuyaFanDevice(TuyaDevice, FanEntity):
|
|||
@property
|
||||
def supported_features(self) -> int:
|
||||
"""Flag supported features."""
|
||||
supports = SUPPORT_SET_SPEED
|
||||
if self._tuya.support_oscillate():
|
||||
supports = supports | SUPPORT_OSCILLATE
|
||||
return supports
|
||||
return SUPPORT_SET_SPEED | SUPPORT_OSCILLATE
|
||||
return SUPPORT_SET_SPEED
|
||||
|
|
|
@ -111,10 +111,9 @@ class XboxMediaPlayer(CoordinatorEntity, MediaPlayerEntity):
|
|||
@property
|
||||
def supported_features(self):
|
||||
"""Flag media player features that are supported."""
|
||||
active_support = SUPPORT_XBOX
|
||||
if self.state not in [STATE_PLAYING, STATE_PAUSED]:
|
||||
active_support &= ~SUPPORT_NEXT_TRACK & ~SUPPORT_PREVIOUS_TRACK
|
||||
return active_support
|
||||
return SUPPORT_XBOX & ~SUPPORT_NEXT_TRACK & ~SUPPORT_PREVIOUS_TRACK
|
||||
return SUPPORT_XBOX
|
||||
|
||||
@property
|
||||
def media_content_type(self):
|
||||
|
|
Loading…
Reference in New Issue