From b38ca5ddd6186502da27715df82932a615488b85 Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Sun, 3 Apr 2022 13:56:46 +0200 Subject: [PATCH] Migrate elkm1 light to color_mode (#69179) --- homeassistant/components/elkm1/light.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/homeassistant/components/elkm1/light.py b/homeassistant/components/elkm1/light.py index e690ad1c575..1ff9c4001cd 100644 --- a/homeassistant/components/elkm1/light.py +++ b/homeassistant/components/elkm1/light.py @@ -3,7 +3,7 @@ from __future__ import annotations from homeassistant.components.light import ( ATTR_BRIGHTNESS, - SUPPORT_BRIGHTNESS, + COLOR_MODE_BRIGHTNESS, LightEntity, ) from homeassistant.config_entries import ConfigEntry @@ -30,6 +30,9 @@ async def async_setup_entry( class ElkLight(ElkEntity, LightEntity): """Representation of an Elk lighting device.""" + _attr_color_mode = COLOR_MODE_BRIGHTNESS + _attr_supported_color_modes = {COLOR_MODE_BRIGHTNESS} + def __init__(self, element, elk, elk_data): """Initialize the Elk light.""" super().__init__(element, elk, elk_data) @@ -40,11 +43,6 @@ class ElkLight(ElkEntity, LightEntity): """Get the brightness.""" return self._brightness - @property - def supported_features(self): - """Flag supported features.""" - return SUPPORT_BRIGHTNESS - @property def is_on(self) -> bool: """Get the current brightness."""