mirror of https://github.com/home-assistant/core
Use ColorMode enum in blebox (#70426)
This commit is contained in:
parent
72b31ca51a
commit
643d04a717
|
@ -6,9 +6,7 @@ from blebox_uniapi.error import BadOnValueError
|
|||
from homeassistant.components.light import (
|
||||
ATTR_BRIGHTNESS,
|
||||
ATTR_RGBW_COLOR,
|
||||
COLOR_MODE_BRIGHTNESS,
|
||||
COLOR_MODE_ONOFF,
|
||||
COLOR_MODE_RGBW,
|
||||
ColorMode,
|
||||
LightEntity,
|
||||
)
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
|
@ -55,10 +53,10 @@ class BleBoxLightEntity(BleBoxEntity, LightEntity):
|
|||
def color_mode(self):
|
||||
"""Return the color mode."""
|
||||
if self._feature.supports_white and self._feature.supports_color:
|
||||
return COLOR_MODE_RGBW
|
||||
return ColorMode.RGBW
|
||||
if self._feature.supports_brightness:
|
||||
return COLOR_MODE_BRIGHTNESS
|
||||
return COLOR_MODE_ONOFF
|
||||
return ColorMode.BRIGHTNESS
|
||||
return ColorMode.ONOFF
|
||||
|
||||
@property
|
||||
def rgbw_color(self):
|
||||
|
|
Loading…
Reference in New Issue