Migrate rfxtrx light to color_mode (#69530)
This commit is contained in:
parent
71b298f3ed
commit
766e6f2e9c
1 changed files with 3 additions and 8 deletions
|
@ -7,7 +7,7 @@ import RFXtrx as rfxtrxmod
|
|||
|
||||
from homeassistant.components.light import (
|
||||
ATTR_BRIGHTNESS,
|
||||
SUPPORT_BRIGHTNESS,
|
||||
COLOR_MODE_BRIGHTNESS,
|
||||
LightEntity,
|
||||
)
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
|
@ -20,8 +20,6 @@ from .const import COMMAND_OFF_LIST, COMMAND_ON_LIST
|
|||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
SUPPORT_RFXTRX = SUPPORT_BRIGHTNESS
|
||||
|
||||
|
||||
def supported(event: rfxtrxmod.RFXtrxEvent):
|
||||
"""Return whether an event supports light."""
|
||||
|
@ -60,6 +58,8 @@ async def async_setup_entry(
|
|||
class RfxtrxLight(RfxtrxCommandEntity, LightEntity):
|
||||
"""Representation of a RFXtrx light."""
|
||||
|
||||
_attr_color_mode = COLOR_MODE_BRIGHTNESS
|
||||
_attr_supported_color_modes = {COLOR_MODE_BRIGHTNESS}
|
||||
_brightness = 0
|
||||
_device: rfxtrxmod.LightingDevice
|
||||
|
||||
|
@ -78,11 +78,6 @@ class RfxtrxLight(RfxtrxCommandEntity, LightEntity):
|
|||
"""Return the brightness of this light between 0..255."""
|
||||
return self._brightness
|
||||
|
||||
@property
|
||||
def supported_features(self):
|
||||
"""Flag supported features."""
|
||||
return SUPPORT_RFXTRX
|
||||
|
||||
@property
|
||||
def is_on(self):
|
||||
"""Return true if device is on."""
|
||||
|
|
Loading…
Add table
Reference in a new issue