Migrate firmata light to color_mode (#69256)
parent
67c95e92b1
commit
5d56f94786
|
@ -5,7 +5,7 @@ import logging
|
|||
|
||||
from homeassistant.components.light import (
|
||||
ATTR_BRIGHTNESS,
|
||||
SUPPORT_BRIGHTNESS,
|
||||
COLOR_MODE_BRIGHTNESS,
|
||||
LightEntity,
|
||||
)
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
|
@ -56,6 +56,9 @@ async def async_setup_entry(
|
|||
class FirmataLight(FirmataPinEntity, LightEntity):
|
||||
"""Representation of a light on a Firmata board."""
|
||||
|
||||
_attr_color_mode = COLOR_MODE_BRIGHTNESS
|
||||
_attr_supported_color_modes = {COLOR_MODE_BRIGHTNESS}
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
api: FirmataBoardPin,
|
||||
|
@ -83,11 +86,6 @@ class FirmataLight(FirmataPinEntity, LightEntity):
|
|||
"""Return the brightness of the light."""
|
||||
return self._api.state
|
||||
|
||||
@property
|
||||
def supported_features(self) -> int:
|
||||
"""Flag supported features."""
|
||||
return SUPPORT_BRIGHTNESS
|
||||
|
||||
async def async_turn_on(self, **kwargs) -> None:
|
||||
"""Turn on light."""
|
||||
level = kwargs.get(ATTR_BRIGHTNESS, self._last_on_level)
|
||||
|
|
Loading…
Reference in New Issue