From 1c1b792fb711c71d173df716299b5954d24260f8 Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Mon, 4 Apr 2022 18:20:48 +0200 Subject: [PATCH] Migrate homeworks light to color_mode (#69271) --- homeassistant/components/homeworks/light.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/homeassistant/components/homeworks/light.py b/homeassistant/components/homeworks/light.py index a8c4fb2d5b5..9f2ffd337e1 100644 --- a/homeassistant/components/homeworks/light.py +++ b/homeassistant/components/homeworks/light.py @@ -7,7 +7,7 @@ from pyhomeworks.pyhomeworks import HW_LIGHT_CHANGED from homeassistant.components.light import ( ATTR_BRIGHTNESS, - SUPPORT_BRIGHTNESS, + COLOR_MODE_BRIGHTNESS, LightEntity, ) from homeassistant.const import CONF_NAME @@ -44,6 +44,9 @@ def setup_platform( class HomeworksLight(HomeworksDevice, LightEntity): """Homeworks Light.""" + _attr_color_mode = COLOR_MODE_BRIGHTNESS + _attr_supported_color_modes = {COLOR_MODE_BRIGHTNESS} + def __init__(self, controller, addr, name, rate): """Create device with Addr, name, and rate.""" super().__init__(controller, addr, name) @@ -60,11 +63,6 @@ class HomeworksLight(HomeworksDevice, LightEntity): ) self._controller.request_dimmer_level(self._addr) - @property - def supported_features(self): - """Supported features.""" - return SUPPORT_BRIGHTNESS - def turn_on(self, **kwargs): """Turn on the light.""" if ATTR_BRIGHTNESS in kwargs: