mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 18:57:06 +00:00
Migrate tellduslive light to color_mode (#69522)
This commit is contained in:
parent
75b1760b29
commit
d33fbbfb6d
@ -4,7 +4,7 @@ import logging
|
|||||||
from homeassistant.components import light, tellduslive
|
from homeassistant.components import light, tellduslive
|
||||||
from homeassistant.components.light import (
|
from homeassistant.components.light import (
|
||||||
ATTR_BRIGHTNESS,
|
ATTR_BRIGHTNESS,
|
||||||
SUPPORT_BRIGHTNESS,
|
COLOR_MODE_BRIGHTNESS,
|
||||||
LightEntity,
|
LightEntity,
|
||||||
)
|
)
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
@ -39,6 +39,9 @@ async def async_setup_entry(
|
|||||||
class TelldusLiveLight(TelldusLiveEntity, LightEntity):
|
class TelldusLiveLight(TelldusLiveEntity, LightEntity):
|
||||||
"""Representation of a Tellstick Net light."""
|
"""Representation of a Tellstick Net light."""
|
||||||
|
|
||||||
|
_attr_color_mode = COLOR_MODE_BRIGHTNESS
|
||||||
|
_attr_supported_color_modes = {COLOR_MODE_BRIGHTNESS}
|
||||||
|
|
||||||
def __init__(self, client, device_id):
|
def __init__(self, client, device_id):
|
||||||
"""Initialize the Tellstick Net light."""
|
"""Initialize the Tellstick Net light."""
|
||||||
super().__init__(client, device_id)
|
super().__init__(client, device_id)
|
||||||
@ -54,11 +57,6 @@ class TelldusLiveLight(TelldusLiveEntity, LightEntity):
|
|||||||
"""Return the brightness of this light between 0..255."""
|
"""Return the brightness of this light between 0..255."""
|
||||||
return self.device.dim_level
|
return self.device.dim_level
|
||||||
|
|
||||||
@property
|
|
||||||
def supported_features(self):
|
|
||||||
"""Flag supported features."""
|
|
||||||
return SUPPORT_BRIGHTNESS
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def is_on(self):
|
def is_on(self):
|
||||||
"""Return true if light is on."""
|
"""Return true if light is on."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user