mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
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 (
|
from homeassistant.components.light import (
|
||||||
ATTR_BRIGHTNESS,
|
ATTR_BRIGHTNESS,
|
||||||
ATTR_RGBW_COLOR,
|
ATTR_RGBW_COLOR,
|
||||||
COLOR_MODE_BRIGHTNESS,
|
ColorMode,
|
||||||
COLOR_MODE_ONOFF,
|
|
||||||
COLOR_MODE_RGBW,
|
|
||||||
LightEntity,
|
LightEntity,
|
||||||
)
|
)
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
@ -55,10 +53,10 @@ class BleBoxLightEntity(BleBoxEntity, LightEntity):
|
|||||||
def color_mode(self):
|
def color_mode(self):
|
||||||
"""Return the color mode."""
|
"""Return the color mode."""
|
||||||
if self._feature.supports_white and self._feature.supports_color:
|
if self._feature.supports_white and self._feature.supports_color:
|
||||||
return COLOR_MODE_RGBW
|
return ColorMode.RGBW
|
||||||
if self._feature.supports_brightness:
|
if self._feature.supports_brightness:
|
||||||
return COLOR_MODE_BRIGHTNESS
|
return ColorMode.BRIGHTNESS
|
||||||
return COLOR_MODE_ONOFF
|
return ColorMode.ONOFF
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def rgbw_color(self):
|
def rgbw_color(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user