Use ColorMode enum in x10 (#70556)

This commit is contained in:
epenet 2022-04-23 22:08:00 +02:00 committed by GitHub
parent d00d9a2473
commit 663dbc4080
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -8,8 +8,8 @@ import voluptuous as vol
from homeassistant.components.light import ( from homeassistant.components.light import (
ATTR_BRIGHTNESS, ATTR_BRIGHTNESS,
COLOR_MODE_BRIGHTNESS,
PLATFORM_SCHEMA, PLATFORM_SCHEMA,
ColorMode,
LightEntity, LightEntity,
) )
from homeassistant.const import CONF_DEVICES, CONF_ID, CONF_NAME from homeassistant.const import CONF_DEVICES, CONF_ID, CONF_NAME
@ -61,8 +61,8 @@ def setup_platform(
class X10Light(LightEntity): class X10Light(LightEntity):
"""Representation of an X10 Light.""" """Representation of an X10 Light."""
_attr_color_mode = COLOR_MODE_BRIGHTNESS _attr_color_mode = ColorMode.BRIGHTNESS
_attr_supported_color_modes = {COLOR_MODE_BRIGHTNESS} _attr_supported_color_modes = {ColorMode.BRIGHTNESS}
def __init__(self, light, is_cm11a): def __init__(self, light, is_cm11a):
"""Initialize an X10 Light.""" """Initialize an X10 Light."""