diff --git a/homeassistant/components/rflink/light.py b/homeassistant/components/rflink/light.py index e07023cbbcd..eb70e931e17 100644 --- a/homeassistant/components/rflink/light.py +++ b/homeassistant/components/rflink/light.py @@ -8,8 +8,9 @@ import voluptuous as vol from homeassistant.components.light import ( ATTR_BRIGHTNESS, + COLOR_MODE_BRIGHTNESS, + COLOR_MODE_ONOFF, PLATFORM_SCHEMA, - SUPPORT_BRIGHTNESS, LightEntity, ) from homeassistant.const import CONF_DEVICES, CONF_NAME, CONF_TYPE @@ -177,6 +178,8 @@ class RflinkLight(SwitchableRflinkDevice, LightEntity): class DimmableRflinkLight(SwitchableRflinkDevice, LightEntity): """Rflink light device that support dimming.""" + _attr_color_mode = COLOR_MODE_BRIGHTNESS + _attr_supported_color_modes = {COLOR_MODE_BRIGHTNESS} _brightness = 255 async def async_added_to_hass(self): @@ -221,11 +224,6 @@ class DimmableRflinkLight(SwitchableRflinkDevice, LightEntity): """Return the brightness of this light between 0..255.""" return self._brightness - @property - def supported_features(self): - """Flag supported features.""" - return SUPPORT_BRIGHTNESS - class HybridRflinkLight(DimmableRflinkLight, LightEntity): """Rflink light device that sends out both dim and on/off commands. @@ -260,6 +258,9 @@ class ToggleRflinkLight(SwitchableRflinkDevice, LightEntity): and if the light is off and 'on' gets sent, the light will turn on. """ + _attr_color_mode = COLOR_MODE_ONOFF + _attr_supported_color_modes = {COLOR_MODE_ONOFF} + def _handle_event(self, event): """Adjust state if Rflink picks up a remote command for this device.""" self.cancel_queued_send_commands()