mirror of
https://github.com/home-assistant/core.git
synced 2025-07-20 11:47:06 +00:00
Use ColorMode enum in rfxtrx (#70530)
This commit is contained in:
parent
1677a76ba4
commit
2ea583536b
@ -5,11 +5,7 @@ import logging
|
|||||||
|
|
||||||
import RFXtrx as rfxtrxmod
|
import RFXtrx as rfxtrxmod
|
||||||
|
|
||||||
from homeassistant.components.light import (
|
from homeassistant.components.light import ATTR_BRIGHTNESS, ColorMode, LightEntity
|
||||||
ATTR_BRIGHTNESS,
|
|
||||||
COLOR_MODE_BRIGHTNESS,
|
|
||||||
LightEntity,
|
|
||||||
)
|
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import STATE_ON
|
from homeassistant.const import STATE_ON
|
||||||
from homeassistant.core import HomeAssistant, callback
|
from homeassistant.core import HomeAssistant, callback
|
||||||
@ -58,8 +54,8 @@ async def async_setup_entry(
|
|||||||
class RfxtrxLight(RfxtrxCommandEntity, LightEntity):
|
class RfxtrxLight(RfxtrxCommandEntity, LightEntity):
|
||||||
"""Representation of a RFXtrx light."""
|
"""Representation of a RFXtrx 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}
|
||||||
_brightness = 0
|
_brightness = 0
|
||||||
_device: rfxtrxmod.LightingDevice
|
_device: rfxtrxmod.LightingDevice
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user