mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Migrate x10 light to color_mode (#69526)
This commit is contained in:
parent
34a9a1d152
commit
72429a6c04
@ -8,8 +8,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_DEVICES, CONF_ID, CONF_NAME
|
||||
@ -20,8 +20,6 @@ from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
SUPPORT_X10 = SUPPORT_BRIGHTNESS
|
||||
|
||||
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
||||
{
|
||||
vol.Required(CONF_DEVICES): vol.All(
|
||||
@ -63,6 +61,9 @@ def setup_platform(
|
||||
class X10Light(LightEntity):
|
||||
"""Representation of an X10 Light."""
|
||||
|
||||
_attr_color_mode = COLOR_MODE_BRIGHTNESS
|
||||
_attr_supported_color_modes = {COLOR_MODE_BRIGHTNESS}
|
||||
|
||||
def __init__(self, light, is_cm11a):
|
||||
"""Initialize an X10 Light."""
|
||||
self._name = light["name"]
|
||||
@ -86,11 +87,6 @@ class X10Light(LightEntity):
|
||||
"""Return true if light is on."""
|
||||
return self._state
|
||||
|
||||
@property
|
||||
def supported_features(self):
|
||||
"""Flag supported features."""
|
||||
return SUPPORT_X10
|
||||
|
||||
def turn_on(self, **kwargs):
|
||||
"""Instruct the light to turn on."""
|
||||
if self._is_cm11a:
|
||||
|
Loading…
x
Reference in New Issue
Block a user