From fb21affe45d11c2e55d1c3e02d1d4d5c1062effd Mon Sep 17 00:00:00 2001 From: Robert Svensson Date: Mon, 7 Jun 2021 12:50:08 +0200 Subject: [PATCH] Replace supported_features property with class attribute in deCONZ light entities (#51558) * Replace supported_features property with class attribute * attr_supported_features is already set to 0 --- homeassistant/components/deconz/light.py | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/homeassistant/components/deconz/light.py b/homeassistant/components/deconz/light.py index 838e7639fc7..60aa02c153e 100644 --- a/homeassistant/components/deconz/light.py +++ b/homeassistant/components/deconz/light.py @@ -106,24 +106,23 @@ class DeconzBaseLight(DeconzDevice, LightEntity): """Set up light.""" super().__init__(device, gateway) - self._features = 0 self.update_features(self._device) def update_features(self, device): """Calculate supported features of device.""" if device.brightness is not None: - self._features |= SUPPORT_BRIGHTNESS - self._features |= SUPPORT_FLASH - self._features |= SUPPORT_TRANSITION + self._attr_supported_features |= SUPPORT_BRIGHTNESS + self._attr_supported_features |= SUPPORT_FLASH + self._attr_supported_features |= SUPPORT_TRANSITION if device.ct is not None: - self._features |= SUPPORT_COLOR_TEMP + self._attr_supported_features |= SUPPORT_COLOR_TEMP if device.xy is not None or (device.hue is not None and device.sat is not None): - self._features |= SUPPORT_COLOR + self._attr_supported_features |= SUPPORT_COLOR if device.effect is not None: - self._features |= SUPPORT_EFFECT + self._attr_supported_features |= SUPPORT_EFFECT @property def brightness(self): @@ -158,11 +157,6 @@ class DeconzBaseLight(DeconzDevice, LightEntity): """Return true if light is on.""" return self._device.state - @property - def supported_features(self): - """Flag supported features.""" - return self._features - async def async_turn_on(self, **kwargs): """Turn on light.""" data = {"on": True}