mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 10:17:09 +00:00
Use LightEntityFeature enum in osramlightify (#71059)
This commit is contained in:
parent
09d61edd9f
commit
faffd809d5
@ -18,9 +18,8 @@ from homeassistant.components.light import (
|
|||||||
SUPPORT_BRIGHTNESS,
|
SUPPORT_BRIGHTNESS,
|
||||||
SUPPORT_COLOR,
|
SUPPORT_COLOR,
|
||||||
SUPPORT_COLOR_TEMP,
|
SUPPORT_COLOR_TEMP,
|
||||||
SUPPORT_EFFECT,
|
|
||||||
SUPPORT_TRANSITION,
|
|
||||||
LightEntity,
|
LightEntity,
|
||||||
|
LightEntityFeature,
|
||||||
)
|
)
|
||||||
from homeassistant.const import CONF_HOST
|
from homeassistant.const import CONF_HOST
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
@ -210,13 +209,18 @@ class Luminary(LightEntity):
|
|||||||
"""Get list of supported features."""
|
"""Get list of supported features."""
|
||||||
features = 0
|
features = 0
|
||||||
if "lum" in self._luminary.supported_features():
|
if "lum" in self._luminary.supported_features():
|
||||||
features = features | SUPPORT_BRIGHTNESS | SUPPORT_TRANSITION
|
features = features | SUPPORT_BRIGHTNESS | LightEntityFeature.TRANSITION
|
||||||
|
|
||||||
if "temp" in self._luminary.supported_features():
|
if "temp" in self._luminary.supported_features():
|
||||||
features = features | SUPPORT_COLOR_TEMP | SUPPORT_TRANSITION
|
features = features | SUPPORT_COLOR_TEMP | LightEntityFeature.TRANSITION
|
||||||
|
|
||||||
if "rgb" in self._luminary.supported_features():
|
if "rgb" in self._luminary.supported_features():
|
||||||
features = features | SUPPORT_COLOR | SUPPORT_TRANSITION | SUPPORT_EFFECT
|
features = (
|
||||||
|
features
|
||||||
|
| SUPPORT_COLOR
|
||||||
|
| LightEntityFeature.TRANSITION
|
||||||
|
| LightEntityFeature.EFFECT
|
||||||
|
)
|
||||||
|
|
||||||
return features
|
return features
|
||||||
|
|
||||||
@ -416,7 +420,7 @@ class OsramLightifyGroup(Luminary):
|
|||||||
"""Get list of supported features."""
|
"""Get list of supported features."""
|
||||||
features = super()._get_supported_features()
|
features = super()._get_supported_features()
|
||||||
if self._luminary.scenes():
|
if self._luminary.scenes():
|
||||||
features = features | SUPPORT_EFFECT
|
features = features | LightEntityFeature.EFFECT
|
||||||
|
|
||||||
return features
|
return features
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user