mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Migrate lutron light to color_mode (#69422)
This commit is contained in:
parent
e8852e0f30
commit
5110565488
@ -3,7 +3,7 @@ from __future__ import annotations
|
|||||||
|
|
||||||
from homeassistant.components.light import (
|
from homeassistant.components.light import (
|
||||||
ATTR_BRIGHTNESS,
|
ATTR_BRIGHTNESS,
|
||||||
SUPPORT_BRIGHTNESS,
|
COLOR_MODE_BRIGHTNESS,
|
||||||
LightEntity,
|
LightEntity,
|
||||||
)
|
)
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
@ -41,16 +41,14 @@ def to_hass_level(level):
|
|||||||
class LutronLight(LutronDevice, LightEntity):
|
class LutronLight(LutronDevice, LightEntity):
|
||||||
"""Representation of a Lutron Light, including dimmable."""
|
"""Representation of a Lutron Light, including dimmable."""
|
||||||
|
|
||||||
|
_attr_color_mode = COLOR_MODE_BRIGHTNESS
|
||||||
|
_attr_supported_color_modes = {COLOR_MODE_BRIGHTNESS}
|
||||||
|
|
||||||
def __init__(self, area_name, lutron_device, controller):
|
def __init__(self, area_name, lutron_device, controller):
|
||||||
"""Initialize the light."""
|
"""Initialize the light."""
|
||||||
self._prev_brightness = None
|
self._prev_brightness = None
|
||||||
super().__init__(area_name, lutron_device, controller)
|
super().__init__(area_name, lutron_device, controller)
|
||||||
|
|
||||||
@property
|
|
||||||
def supported_features(self):
|
|
||||||
"""Flag supported features."""
|
|
||||||
return SUPPORT_BRIGHTNESS
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def brightness(self):
|
def brightness(self):
|
||||||
"""Return the brightness of the light."""
|
"""Return the brightness of the light."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user