From f77bcd252e3fe125308c30b72ee18db04e22fb88 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Wed, 27 Apr 2022 14:16:51 +0200 Subject: [PATCH] Migrate opple light to ColorMode (#70875) --- homeassistant/components/opple/light.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/homeassistant/components/opple/light.py b/homeassistant/components/opple/light.py index 6965deb0791..a9e24029a13 100644 --- a/homeassistant/components/opple/light.py +++ b/homeassistant/components/opple/light.py @@ -10,8 +10,7 @@ from homeassistant.components.light import ( ATTR_BRIGHTNESS, ATTR_COLOR_TEMP, PLATFORM_SCHEMA, - SUPPORT_BRIGHTNESS, - SUPPORT_COLOR_TEMP, + ColorMode, LightEntity, ) from homeassistant.const import CONF_HOST, CONF_NAME @@ -55,6 +54,9 @@ def setup_platform( class OppleLight(LightEntity): """Opple light device.""" + _attr_color_mode = ColorMode.COLOR_TEMP + _attr_supported_color_modes = {ColorMode.COLOR_TEMP} + def __init__(self, name, host): """Initialize an Opple light.""" @@ -105,11 +107,6 @@ class OppleLight(LightEntity): """Return maximum supported color temperature.""" return 333 - @property - def supported_features(self): - """Flag supported features.""" - return SUPPORT_BRIGHTNESS | SUPPORT_COLOR_TEMP - def turn_on(self, **kwargs): """Instruct the light to turn on.""" _LOGGER.debug("Turn on light %s %s", self._device.ip, kwargs)