Migrate isy994 light to color_mode (#69282)
This commit is contained in:
parent
dffb3cc196
commit
e9a60418c2
1 changed files with 4 additions and 6 deletions
|
@ -8,8 +8,8 @@ from pyisy.helpers import NodeProperty
|
|||
from pyisy.nodes import Node
|
||||
|
||||
from homeassistant.components.light import (
|
||||
COLOR_MODE_BRIGHTNESS,
|
||||
DOMAIN as LIGHT,
|
||||
SUPPORT_BRIGHTNESS,
|
||||
LightEntity,
|
||||
)
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
|
@ -51,6 +51,9 @@ async def async_setup_entry(
|
|||
class ISYLightEntity(ISYNodeEntity, LightEntity, RestoreEntity):
|
||||
"""Representation of an ISY994 light device."""
|
||||
|
||||
_attr_color_mode = COLOR_MODE_BRIGHTNESS
|
||||
_attr_supported_color_modes = {COLOR_MODE_BRIGHTNESS}
|
||||
|
||||
def __init__(self, node: Node, restore_light_state: bool) -> None:
|
||||
"""Initialize the ISY994 light device."""
|
||||
super().__init__(node)
|
||||
|
@ -108,11 +111,6 @@ class ISYLightEntity(ISYNodeEntity, LightEntity, RestoreEntity):
|
|||
attribs[ATTR_LAST_BRIGHTNESS] = self._last_brightness
|
||||
return attribs
|
||||
|
||||
@property
|
||||
def supported_features(self) -> int:
|
||||
"""Flag supported features."""
|
||||
return SUPPORT_BRIGHTNESS
|
||||
|
||||
async def async_added_to_hass(self) -> None:
|
||||
"""Restore last_brightness on restart."""
|
||||
await super().async_added_to_hass()
|
||||
|
|
Loading…
Add table
Reference in a new issue