Migrate mochad light to color_mode (#69425)

pull/69587/head
Erik Montnemery 2022-04-07 14:52:49 +02:00 committed by GitHub
parent c43bd047fd
commit 0c72a39e23
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 6 deletions

View File

@ -9,8 +9,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_ADDRESS, CONF_DEVICES, CONF_NAME, CONF_PLATFORM
@ -56,6 +56,9 @@ def setup_platform(
class MochadLight(LightEntity):
"""Representation of a X10 dimmer over Mochad."""
_attr_color_mode = COLOR_MODE_BRIGHTNESS
_attr_supported_color_modes = {COLOR_MODE_BRIGHTNESS}
def __init__(self, hass, ctrl, dev):
"""Initialize a Mochad Light Device."""
@ -89,11 +92,6 @@ class MochadLight(LightEntity):
"""Return true if the light is on."""
return self._state
@property
def supported_features(self):
"""Return supported features."""
return SUPPORT_BRIGHTNESS
@property
def assumed_state(self):
"""X10 devices are normally 1-way so we have to assume the state."""