From 0c72a39e2308fdddab7e5ab48c53efc3c076c2ce Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Thu, 7 Apr 2022 14:52:49 +0200 Subject: [PATCH] Migrate mochad light to color_mode (#69425) --- homeassistant/components/mochad/light.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/homeassistant/components/mochad/light.py b/homeassistant/components/mochad/light.py index a966d0ad9f6..7a6f264e0bc 100644 --- a/homeassistant/components/mochad/light.py +++ b/homeassistant/components/mochad/light.py @@ -9,8 +9,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_ADDRESS, CONF_DEVICES, CONF_NAME, CONF_PLATFORM @@ -56,6 +56,9 @@ def setup_platform( class MochadLight(LightEntity): """Representation of a X10 dimmer over Mochad.""" + _attr_color_mode = COLOR_MODE_BRIGHTNESS + _attr_supported_color_modes = {COLOR_MODE_BRIGHTNESS} + def __init__(self, hass, ctrl, dev): """Initialize a Mochad Light Device.""" @@ -89,11 +92,6 @@ class MochadLight(LightEntity): """Return true if the light is on.""" return self._state - @property - def supported_features(self): - """Return supported features.""" - return SUPPORT_BRIGHTNESS - @property def assumed_state(self): """X10 devices are normally 1-way so we have to assume the state."""