Assign color_mode for mqtt light as ColorMode (#100709)

This commit is contained in:
Jan Bouwhuis 2023-09-22 12:09:37 +02:00 committed by GitHub
parent 384adb1c87
commit a66ad39c4e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -557,7 +557,7 @@ class MqttLight(MqttEntity, LightEntity, RestoreEntity):
_LOGGER.debug("Ignoring empty color mode message from '%s'", msg.topic)
return
self._attr_color_mode = str(payload)
self._attr_color_mode = ColorMode(str(payload))
get_mqtt_data(self.hass).state_write_requests.write_state_request(self)
add_topic(CONF_COLOR_MODE_STATE_TOPIC, color_mode_received)

View File

@ -3175,9 +3175,9 @@ async def test_reloadable(
("state_topic", "ON", None, "on", None),
(
"color_mode_state_topic",
"200",
"rgb",
"color_mode",
"200",
"rgb",
("state_topic", "ON"),
),
("color_temp_state_topic", "200", "color_temp", 200, ("state_topic", "ON")),