Use ColorMode enum in homeworks (#70506)

This commit is contained in:
epenet 2022-04-23 21:15:40 +02:00 committed by GitHub
parent e30b3b4ab1
commit ee1ac730b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,11 +5,7 @@ import logging
from pyhomeworks.pyhomeworks import HW_LIGHT_CHANGED
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
COLOR_MODE_BRIGHTNESS,
LightEntity,
)
from homeassistant.components.light import ATTR_BRIGHTNESS, ColorMode, LightEntity
from homeassistant.const import CONF_NAME
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.dispatcher import async_dispatcher_connect
@ -44,8 +40,8 @@ def setup_platform(
class HomeworksLight(HomeworksDevice, LightEntity):
"""Homeworks Light."""
_attr_color_mode = COLOR_MODE_BRIGHTNESS
_attr_supported_color_modes = {COLOR_MODE_BRIGHTNESS}
_attr_color_mode = ColorMode.BRIGHTNESS
_attr_supported_color_modes = {ColorMode.BRIGHTNESS}
def __init__(self, controller, addr, name, rate):
"""Create device with Addr, name, and rate."""