Set deprecated supported_features for MQTT JSON light (#49167)

* Set deprecated supported_features for MQTT json light

* Update homeassistant/components/light/__init__.py

Co-authored-by: Franck Nijhof <git@frenck.dev>

Co-authored-by: Franck Nijhof <git@frenck.dev>
This commit is contained in:
Erik Montnemery 2021-04-15 17:24:21 +02:00 committed by GitHub
parent 1b5148a3af
commit ec56ae2cbc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 80 additions and 13 deletions

View file

@ -35,6 +35,7 @@ from homeassistant.components.light import (
SUPPORT_WHITE_VALUE,
VALID_COLOR_MODES,
LightEntity,
legacy_supported_features,
valid_supported_color_modes,
)
from homeassistant.const import (
@ -458,7 +459,9 @@ class MqttLightJson(MqttEntity, LightEntity, RestoreEntity):
@property
def supported_features(self):
"""Flag supported features."""
return self._supported_features
return legacy_supported_features(
self._supported_features, self._config.get(CONF_SUPPORTED_COLOR_MODES)
)
def _set_flash_and_transition(self, message, **kwargs):
if ATTR_TRANSITION in kwargs: