diff --git a/homeassistant/components/pilight/light.py b/homeassistant/components/pilight/light.py index 2838895159c..fb57a39d394 100644 --- a/homeassistant/components/pilight/light.py +++ b/homeassistant/components/pilight/light.py @@ -5,8 +5,8 @@ import voluptuous as vol from homeassistant.components.light import ( ATTR_BRIGHTNESS, + COLOR_MODE_BRIGHTNESS, PLATFORM_SCHEMA, - SUPPORT_BRIGHTNESS, LightEntity, ) from homeassistant.const import CONF_LIGHTS @@ -49,6 +49,9 @@ def setup_platform( class PilightLight(PilightBaseDevice, LightEntity): """Representation of a Pilight switch.""" + _attr_color_mode = COLOR_MODE_BRIGHTNESS + _attr_supported_color_modes = {COLOR_MODE_BRIGHTNESS} + def __init__(self, hass, name, config): """Initialize a switch.""" super().__init__(hass, name, config) @@ -60,11 +63,6 @@ class PilightLight(PilightBaseDevice, LightEntity): """Return the brightness.""" return self._brightness - @property - def supported_features(self): - """Flag supported features.""" - return SUPPORT_BRIGHTNESS - def turn_on(self, **kwargs): """Turn the switch on by calling pilight.send service with on code.""" # Update brightness only if provided as an argument.