mirror of
https://github.com/home-assistant/core.git
synced 2025-07-30 02:38:10 +02:00
Force color or white mode exclusivity for Tasmota lights (#42772)
This commit is contained in:
@ -432,6 +432,8 @@ async def test_controlling_state_via_mqtt_rgbww(hass, mqtt_mock, setup_tasmota):
|
||||
state = hass.states.get("light.test")
|
||||
assert state.state == STATE_ON
|
||||
assert state.attributes.get("white_value") == 127.5
|
||||
# Setting white > 0 should clear the color
|
||||
assert not state.attributes.get("rgb_color")
|
||||
|
||||
async_fire_mqtt_message(
|
||||
hass, "tasmota_49A3BC/tele/STATE", '{"POWER":"ON","CT":300}'
|
||||
@ -440,6 +442,15 @@ async def test_controlling_state_via_mqtt_rgbww(hass, mqtt_mock, setup_tasmota):
|
||||
assert state.state == STATE_ON
|
||||
assert state.attributes.get("color_temp") == 300
|
||||
|
||||
async_fire_mqtt_message(
|
||||
hass, "tasmota_49A3BC/tele/STATE", '{"POWER":"ON","White":0}'
|
||||
)
|
||||
state = hass.states.get("light.test")
|
||||
assert state.state == STATE_ON
|
||||
# Setting white to 0 should clear the white_value and color_temp
|
||||
assert not state.attributes.get("white_value")
|
||||
assert not state.attributes.get("color_temp")
|
||||
|
||||
async_fire_mqtt_message(
|
||||
hass, "tasmota_49A3BC/tele/STATE", '{"POWER":"ON","Scheme":3}'
|
||||
)
|
||||
|
Reference in New Issue
Block a user