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:
parent
1b5148a3af
commit
ec56ae2cbc
3 changed files with 80 additions and 13 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue