Use ColorMode enum in decora (#70429)

This commit is contained in:
epenet 2022-04-23 07:49:14 +02:00 committed by GitHub
parent 7ffe399a08
commit 35e395235a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,8 +13,8 @@ import voluptuous as vol
from homeassistant import util from homeassistant import util
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_API_KEY, CONF_DEVICES, CONF_NAME from homeassistant.const import CONF_API_KEY, CONF_DEVICES, CONF_NAME
@ -96,8 +96,8 @@ def setup_platform(
class DecoraLight(LightEntity): class DecoraLight(LightEntity):
"""Representation of an Decora light.""" """Representation of an Decora 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, device): def __init__(self, device):
"""Initialize the light.""" """Initialize the light."""