mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Use ColorMode enum in homeworks (#70506)
This commit is contained in:
parent
e30b3b4ab1
commit
ee1ac730b8
@ -5,11 +5,7 @@ import logging
|
|||||||
|
|
||||||
from pyhomeworks.pyhomeworks import HW_LIGHT_CHANGED
|
from pyhomeworks.pyhomeworks import HW_LIGHT_CHANGED
|
||||||
|
|
||||||
from homeassistant.components.light import (
|
from homeassistant.components.light import ATTR_BRIGHTNESS, ColorMode, LightEntity
|
||||||
ATTR_BRIGHTNESS,
|
|
||||||
COLOR_MODE_BRIGHTNESS,
|
|
||||||
LightEntity,
|
|
||||||
)
|
|
||||||
from homeassistant.const import CONF_NAME
|
from homeassistant.const import CONF_NAME
|
||||||
from homeassistant.core import HomeAssistant, callback
|
from homeassistant.core import HomeAssistant, callback
|
||||||
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
||||||
@ -44,8 +40,8 @@ def setup_platform(
|
|||||||
class HomeworksLight(HomeworksDevice, LightEntity):
|
class HomeworksLight(HomeworksDevice, LightEntity):
|
||||||
"""Homeworks Light."""
|
"""Homeworks 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, controller, addr, name, rate):
|
def __init__(self, controller, addr, name, rate):
|
||||||
"""Create device with Addr, name, and rate."""
|
"""Create device with Addr, name, and rate."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user