Use unknown color_mode for MQTT json lights if color mode is not set (#108909)
This commit is contained in:
parent
00c2ba69f7
commit
7bec5ef6bc
2 changed files with 76 additions and 0 deletions
|
@ -220,6 +220,8 @@ class MqttLightJson(MqttEntity, LightEntity, RestoreEntity):
|
|||
self._attr_supported_color_modes = self._config[CONF_SUPPORTED_COLOR_MODES]
|
||||
if self.supported_color_modes and len(self.supported_color_modes) == 1:
|
||||
self._attr_color_mode = next(iter(self.supported_color_modes))
|
||||
else:
|
||||
self._attr_color_mode = ColorMode.UNKNOWN
|
||||
|
||||
def _update_color(self, values: dict[str, Any]) -> None:
|
||||
if not self._config[CONF_COLOR_MODE]:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue