mirror of
https://github.com/home-assistant/core.git
synced 2025-04-24 09:17:53 +00:00
Migrate pilight light to color_mode (#69531)
This commit is contained in:
parent
8cba371318
commit
a10a1794d9
@ -5,8 +5,8 @@ import voluptuous as vol
|
||||
|
||||
from homeassistant.components.light import (
|
||||
ATTR_BRIGHTNESS,
|
||||
COLOR_MODE_BRIGHTNESS,
|
||||
PLATFORM_SCHEMA,
|
||||
SUPPORT_BRIGHTNESS,
|
||||
LightEntity,
|
||||
)
|
||||
from homeassistant.const import CONF_LIGHTS
|
||||
@ -49,6 +49,9 @@ def setup_platform(
|
||||
class PilightLight(PilightBaseDevice, LightEntity):
|
||||
"""Representation of a Pilight switch."""
|
||||
|
||||
_attr_color_mode = COLOR_MODE_BRIGHTNESS
|
||||
_attr_supported_color_modes = {COLOR_MODE_BRIGHTNESS}
|
||||
|
||||
def __init__(self, hass, name, config):
|
||||
"""Initialize a switch."""
|
||||
super().__init__(hass, name, config)
|
||||
@ -60,11 +63,6 @@ class PilightLight(PilightBaseDevice, LightEntity):
|
||||
"""Return the brightness."""
|
||||
return self._brightness
|
||||
|
||||
@property
|
||||
def supported_features(self):
|
||||
"""Flag supported features."""
|
||||
return SUPPORT_BRIGHTNESS
|
||||
|
||||
def turn_on(self, **kwargs):
|
||||
"""Turn the switch on by calling pilight.send service with on code."""
|
||||
# Update brightness only if provided as an argument.
|
||||
|
Loading…
x
Reference in New Issue
Block a user