Use LightEntityFeature enum in template (#71056)

This commit is contained in:
epenet 2022-04-29 21:43:33 +02:00 committed by GitHub
parent 6bb685eaba
commit e63aef79fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -16,10 +16,9 @@ from homeassistant.components.light import (
SUPPORT_BRIGHTNESS,
SUPPORT_COLOR,
SUPPORT_COLOR_TEMP,
SUPPORT_EFFECT,
SUPPORT_TRANSITION,
SUPPORT_WHITE_VALUE,
LightEntity,
LightEntityFeature,
)
from homeassistant.const import (
CONF_ENTITY_ID,
@ -254,9 +253,9 @@ class LightTemplate(TemplateEntity, LightEntity):
if self._white_value_script is not None:
supported_features |= SUPPORT_WHITE_VALUE
if self._effect_script is not None:
supported_features |= SUPPORT_EFFECT
supported_features |= LightEntityFeature.EFFECT
if self._supports_transition is True:
supported_features |= SUPPORT_TRANSITION
supported_features |= LightEntityFeature.TRANSITION
return supported_features
@property