diff --git a/homeassistant/components/niko_home_control/light.py b/homeassistant/components/niko_home_control/light.py index ef3efec9b71..f4d62fd6dc2 100644 --- a/homeassistant/components/niko_home_control/light.py +++ b/homeassistant/components/niko_home_control/light.py @@ -8,7 +8,7 @@ import nikohomecontrol import voluptuous as vol # Import the device class from the component that you want to support -from homeassistant.components.light import ATTR_BRIGHTNESS, PLATFORM_SCHEMA, LightEntity +from homeassistant.components.light import PLATFORM_SCHEMA, ColorMode, LightEntity from homeassistant.const import CONF_HOST from homeassistant.core import HomeAssistant from homeassistant.exceptions import PlatformNotReady @@ -51,6 +51,9 @@ async def async_setup_platform( class NikoHomeControlLight(LightEntity): """Representation of an Niko Light.""" + _attr_color_mode = ColorMode.ONOFF + _attr_supported_color_modes = {ColorMode.ONOFF} + def __init__(self, light, data): """Set up the Niko Home Control light platform.""" self._data = data @@ -58,7 +61,6 @@ class NikoHomeControlLight(LightEntity): self._unique_id = f"light-{light.id}" self._name = light.name self._state = light.is_on - self._brightness = None @property def unique_id(self): @@ -70,11 +72,6 @@ class NikoHomeControlLight(LightEntity): """Return the display name of this light.""" return self._name - @property - def brightness(self): - """Return the brightness of the light.""" - return self._brightness - @property def is_on(self): """Return true if light is on.""" @@ -82,7 +79,6 @@ class NikoHomeControlLight(LightEntity): def turn_on(self, **kwargs): """Instruct the light to turn on.""" - self._light.brightness = kwargs.get(ATTR_BRIGHTNESS, 255) _LOGGER.debug("Turn on: %s", self.name) self._light.turn_on()