diff --git a/homeassistant/components/rfxtrx/light.py b/homeassistant/components/rfxtrx/light.py index 7212b65cd7e..58e7d4673c8 100644 --- a/homeassistant/components/rfxtrx/light.py +++ b/homeassistant/components/rfxtrx/light.py @@ -7,7 +7,7 @@ import RFXtrx as rfxtrxmod from homeassistant.components.light import ( ATTR_BRIGHTNESS, - SUPPORT_BRIGHTNESS, + COLOR_MODE_BRIGHTNESS, LightEntity, ) from homeassistant.config_entries import ConfigEntry @@ -20,8 +20,6 @@ from .const import COMMAND_OFF_LIST, COMMAND_ON_LIST _LOGGER = logging.getLogger(__name__) -SUPPORT_RFXTRX = SUPPORT_BRIGHTNESS - def supported(event: rfxtrxmod.RFXtrxEvent): """Return whether an event supports light.""" @@ -60,6 +58,8 @@ async def async_setup_entry( class RfxtrxLight(RfxtrxCommandEntity, LightEntity): """Representation of a RFXtrx light.""" + _attr_color_mode = COLOR_MODE_BRIGHTNESS + _attr_supported_color_modes = {COLOR_MODE_BRIGHTNESS} _brightness = 0 _device: rfxtrxmod.LightingDevice @@ -78,11 +78,6 @@ class RfxtrxLight(RfxtrxCommandEntity, LightEntity): """Return the brightness of this light between 0..255.""" return self._brightness - @property - def supported_features(self): - """Flag supported features.""" - return SUPPORT_RFXTRX - @property def is_on(self): """Return true if device is on."""