mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +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 (
|
||||
ATTR_BRIGHTNESS,
|
||||
SUPPORT_BRIGHTNESS,
|
||||
COLOR_MODE_BRIGHTNESS,
|
||||
LightEntity,
|
||||
)
|
||||
from homeassistant.core import HomeAssistant
|
||||
@ -41,16 +41,14 @@ def to_hass_level(level):
|
||||
class LutronLight(LutronDevice, LightEntity):
|
||||
"""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):
|
||||
"""Initialize the light."""
|
||||
self._prev_brightness = None
|
||||
super().__init__(area_name, lutron_device, controller)
|
||||
|
||||
@property
|
||||
def supported_features(self):
|
||||
"""Flag supported features."""
|
||||
return SUPPORT_BRIGHTNESS
|
||||
|
||||
@property
|
||||
def brightness(self):
|
||||
"""Return the brightness of the light."""
|
||||
|
Loading…
x
Reference in New Issue
Block a user