diff --git a/homeassistant/components/ads/light.py b/homeassistant/components/ads/light.py index 82ead5fbf59..80ee5df0c4b 100644 --- a/homeassistant/components/ads/light.py +++ b/homeassistant/components/ads/light.py @@ -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): diff --git a/homeassistant/components/bond/light.py b/homeassistant/components/bond/light.py index 82187bf6fab..77771167e14 100644 --- a/homeassistant/components/bond/light.py +++ b/homeassistant/components/bond/light.py @@ -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: diff --git a/homeassistant/components/control4/light.py b/homeassistant/components/control4/light.py index 08ac23e40e2..f8c94c6a932 100644 --- a/homeassistant/components/control4/light.py +++ b/homeassistant/components/control4/light.py @@ -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.""" diff --git a/homeassistant/components/lcn/light.py b/homeassistant/components/lcn/light.py index e76becc0e9f..8fd24c43069 100644 --- a/homeassistant/components/lcn/light.py +++ b/homeassistant/components/lcn/light.py @@ -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): diff --git a/homeassistant/components/nest/camera_sdm.py b/homeassistant/components/nest/camera_sdm.py index 88a7efe9623..c7f5fc97f92 100644 --- a/homeassistant/components/nest/camera_sdm.py +++ b/homeassistant/components/nest/camera_sdm.py @@ -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.""" diff --git a/homeassistant/components/spider/climate.py b/homeassistant/components/spider/climate.py index d9477c2a4fb..234ae699bca 100644 --- a/homeassistant/components/spider/climate.py +++ b/homeassistant/components/spider/climate.py @@ -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): diff --git a/homeassistant/components/tuya/cover.py b/homeassistant/components/tuya/cover.py index 2d5d5e036a1..08f1d92aca5 100644 --- a/homeassistant/components/tuya/cover.py +++ b/homeassistant/components/tuya/cover.py @@ -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): diff --git a/homeassistant/components/tuya/fan.py b/homeassistant/components/tuya/fan.py index 39510e1cb3a..e88349cf795 100644 --- a/homeassistant/components/tuya/fan.py +++ b/homeassistant/components/tuya/fan.py @@ -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 diff --git a/homeassistant/components/xbox/media_player.py b/homeassistant/components/xbox/media_player.py index 41aaa7eeb9c..19e8a90d48e 100644 --- a/homeassistant/components/xbox/media_player.py +++ b/homeassistant/components/xbox/media_player.py @@ -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):