mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 12:17:07 +00:00
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
|
@property
|
||||||
def supported_features(self):
|
def supported_features(self):
|
||||||
"""Flag supported features."""
|
"""Flag supported features."""
|
||||||
support = 0
|
|
||||||
if self._ads_var_brightness is not None:
|
if self._ads_var_brightness is not None:
|
||||||
support = SUPPORT_BRIGHTNESS
|
return SUPPORT_BRIGHTNESS
|
||||||
return support
|
return 0
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def is_on(self):
|
def is_on(self):
|
||||||
|
@ -68,11 +68,9 @@ class BondLight(BondEntity, LightEntity):
|
|||||||
@property
|
@property
|
||||||
def supported_features(self) -> Optional[int]:
|
def supported_features(self) -> Optional[int]:
|
||||||
"""Flag supported features."""
|
"""Flag supported features."""
|
||||||
features = 0
|
|
||||||
if self._device.supports_set_brightness():
|
if self._device.supports_set_brightness():
|
||||||
features |= SUPPORT_BRIGHTNESS
|
return SUPPORT_BRIGHTNESS
|
||||||
|
return 0
|
||||||
return features
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def is_on(self) -> bool:
|
def is_on(self) -> bool:
|
||||||
|
@ -187,10 +187,9 @@ class Control4Light(Control4Entity, LightEntity):
|
|||||||
@property
|
@property
|
||||||
def supported_features(self) -> int:
|
def supported_features(self) -> int:
|
||||||
"""Flag supported features."""
|
"""Flag supported features."""
|
||||||
flags = 0
|
|
||||||
if self._is_dimmer:
|
if self._is_dimmer:
|
||||||
flags |= SUPPORT_BRIGHTNESS | SUPPORT_TRANSITION
|
return SUPPORT_BRIGHTNESS | SUPPORT_TRANSITION
|
||||||
return flags
|
return 0
|
||||||
|
|
||||||
async def async_turn_on(self, **kwargs) -> None:
|
async def async_turn_on(self, **kwargs) -> None:
|
||||||
"""Turn the entity on."""
|
"""Turn the entity on."""
|
||||||
|
@ -71,10 +71,9 @@ class LcnOutputLight(LcnDevice, LightEntity):
|
|||||||
@property
|
@property
|
||||||
def supported_features(self):
|
def supported_features(self):
|
||||||
"""Flag supported features."""
|
"""Flag supported features."""
|
||||||
features = SUPPORT_TRANSITION
|
|
||||||
if self.dimmable:
|
if self.dimmable:
|
||||||
features |= SUPPORT_BRIGHTNESS
|
return SUPPORT_TRANSITION | SUPPORT_BRIGHTNESS
|
||||||
return features
|
return SUPPORT_TRANSITION
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def brightness(self):
|
def brightness(self):
|
||||||
|
@ -84,10 +84,9 @@ class NestCamera(Camera):
|
|||||||
@property
|
@property
|
||||||
def supported_features(self):
|
def supported_features(self):
|
||||||
"""Flag supported features."""
|
"""Flag supported features."""
|
||||||
features = 0
|
|
||||||
if CameraLiveStreamTrait.NAME in self._device.traits:
|
if CameraLiveStreamTrait.NAME in self._device.traits:
|
||||||
features = features | SUPPORT_STREAM
|
return SUPPORT_STREAM
|
||||||
return features
|
return 0
|
||||||
|
|
||||||
async def stream_source(self):
|
async def stream_source(self):
|
||||||
"""Return the source of the stream."""
|
"""Return the source of the stream."""
|
||||||
|
@ -44,12 +44,9 @@ class SpiderThermostat(ClimateEntity):
|
|||||||
@property
|
@property
|
||||||
def supported_features(self):
|
def supported_features(self):
|
||||||
"""Return the list of supported features."""
|
"""Return the list of supported features."""
|
||||||
supports = SUPPORT_TARGET_TEMPERATURE
|
|
||||||
|
|
||||||
if self.thermostat.has_fan_mode:
|
if self.thermostat.has_fan_mode:
|
||||||
supports |= SUPPORT_FAN_MODE
|
return SUPPORT_TARGET_TEMPERATURE | SUPPORT_FAN_MODE
|
||||||
|
return SUPPORT_TARGET_TEMPERATURE
|
||||||
return supports
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def unique_id(self):
|
def unique_id(self):
|
||||||
|
@ -68,10 +68,9 @@ class TuyaCover(TuyaDevice, CoverEntity):
|
|||||||
@property
|
@property
|
||||||
def supported_features(self):
|
def supported_features(self):
|
||||||
"""Flag supported features."""
|
"""Flag supported features."""
|
||||||
supported_features = SUPPORT_OPEN | SUPPORT_CLOSE
|
|
||||||
if self._tuya.support_stop():
|
if self._tuya.support_stop():
|
||||||
supported_features |= SUPPORT_STOP
|
return SUPPORT_OPEN | SUPPORT_CLOSE | SUPPORT_STOP
|
||||||
return supported_features
|
return SUPPORT_OPEN | SUPPORT_CLOSE
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def is_opening(self):
|
def is_opening(self):
|
||||||
|
@ -119,7 +119,6 @@ class TuyaFanDevice(TuyaDevice, FanEntity):
|
|||||||
@property
|
@property
|
||||||
def supported_features(self) -> int:
|
def supported_features(self) -> int:
|
||||||
"""Flag supported features."""
|
"""Flag supported features."""
|
||||||
supports = SUPPORT_SET_SPEED
|
|
||||||
if self._tuya.support_oscillate():
|
if self._tuya.support_oscillate():
|
||||||
supports = supports | SUPPORT_OSCILLATE
|
return SUPPORT_SET_SPEED | SUPPORT_OSCILLATE
|
||||||
return supports
|
return SUPPORT_SET_SPEED
|
||||||
|
@ -111,10 +111,9 @@ class XboxMediaPlayer(CoordinatorEntity, MediaPlayerEntity):
|
|||||||
@property
|
@property
|
||||||
def supported_features(self):
|
def supported_features(self):
|
||||||
"""Flag media player features that are supported."""
|
"""Flag media player features that are supported."""
|
||||||
active_support = SUPPORT_XBOX
|
|
||||||
if self.state not in [STATE_PLAYING, STATE_PAUSED]:
|
if self.state not in [STATE_PLAYING, STATE_PAUSED]:
|
||||||
active_support &= ~SUPPORT_NEXT_TRACK & ~SUPPORT_PREVIOUS_TRACK
|
return SUPPORT_XBOX & ~SUPPORT_NEXT_TRACK & ~SUPPORT_PREVIOUS_TRACK
|
||||||
return active_support
|
return SUPPORT_XBOX
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def media_content_type(self):
|
def media_content_type(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user