Fix brightness slider for mqtt template lights (#5780)

Add the missing supported_features declaration.
This commit is contained in:
ray0711 2017-02-07 08:52:07 +01:00 committed by andrey-git
parent 305d2612cf
commit 1546ec7778

View File

@ -284,3 +284,16 @@ class MqttTemplate(Light):
if self._optimistic:
self.schedule_update_ha_state()
@property
def supported_features(self):
"""Flag supported features."""
features = 0
if self._brightness is not None:
features = features | SUPPORT_BRIGHTNESS
if self._rgb is not None:
features = features | SUPPORT_RGB_COLOR
if self._effect_list is not None:
features = features | SUPPORT_EFFECT
return features