Enforce LightEntityFeature (#82460)

This commit is contained in:
epenet 2022-11-22 07:14:47 +01:00 committed by GitHub
parent d4bd9a0f7e
commit 7f1e1ed1d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 27 additions and 28 deletions

View file

@ -415,11 +415,9 @@ class MqttLight(MqttEntity, LightEntity, RestoreEntity):
supported_color_modes
)
supported_features: int = 0
supported_features |= (
topic[CONF_EFFECT_COMMAND_TOPIC] is not None and LightEntityFeature.EFFECT
)
self._attr_supported_features = supported_features
self._attr_supported_features = LightEntityFeature(0)
if topic[CONF_EFFECT_COMMAND_TOPIC] is not None:
self._attr_supported_features |= LightEntityFeature.EFFECT
def _is_optimistic(self, attribute: str) -> bool:
"""Return True if the attribute is optimistically updated."""