mirror of
https://github.com/home-assistant/core.git
synced 2025-07-09 14:27:07 +00:00
Migrate opple light to ColorMode (#70875)
This commit is contained in:
parent
13cc7583ed
commit
f77bcd252e
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user