mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 02:07:09 +00:00
Use LightEntityFeature enum in template (#71056)
This commit is contained in:
parent
6bb685eaba
commit
e63aef79fe
@ -16,10 +16,9 @@ from homeassistant.components.light import (
|
|||||||
SUPPORT_BRIGHTNESS,
|
SUPPORT_BRIGHTNESS,
|
||||||
SUPPORT_COLOR,
|
SUPPORT_COLOR,
|
||||||
SUPPORT_COLOR_TEMP,
|
SUPPORT_COLOR_TEMP,
|
||||||
SUPPORT_EFFECT,
|
|
||||||
SUPPORT_TRANSITION,
|
|
||||||
SUPPORT_WHITE_VALUE,
|
SUPPORT_WHITE_VALUE,
|
||||||
LightEntity,
|
LightEntity,
|
||||||
|
LightEntityFeature,
|
||||||
)
|
)
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
CONF_ENTITY_ID,
|
CONF_ENTITY_ID,
|
||||||
@ -254,9 +253,9 @@ class LightTemplate(TemplateEntity, LightEntity):
|
|||||||
if self._white_value_script is not None:
|
if self._white_value_script is not None:
|
||||||
supported_features |= SUPPORT_WHITE_VALUE
|
supported_features |= SUPPORT_WHITE_VALUE
|
||||||
if self._effect_script is not None:
|
if self._effect_script is not None:
|
||||||
supported_features |= SUPPORT_EFFECT
|
supported_features |= LightEntityFeature.EFFECT
|
||||||
if self._supports_transition is True:
|
if self._supports_transition is True:
|
||||||
supported_features |= SUPPORT_TRANSITION
|
supported_features |= LightEntityFeature.TRANSITION
|
||||||
return supported_features
|
return supported_features
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
Loading…
x
Reference in New Issue
Block a user