mirror of
https://github.com/home-assistant/core.git
synced 2025-07-30 02:38:10 +02:00
Fix handling MQTT light brightness from zero rgb (#96286)
* Fix handling MQTT light brightness from zero rgb * Fix log message
This commit is contained in:
@ -666,6 +666,12 @@ async def test_brightness_from_rgb_controlling_scale(
|
||||
assert state.attributes.get("brightness") == 128
|
||||
assert state.attributes.get("rgb_color") == (255, 128, 64)
|
||||
|
||||
# Test zero rgb is ignored
|
||||
async_fire_mqtt_message(hass, "test_scale_rgb/rgb/status", "0,0,0")
|
||||
state = hass.states.get("light.test")
|
||||
assert state.attributes.get("brightness") == 128
|
||||
assert state.attributes.get("rgb_color") == (255, 128, 64)
|
||||
|
||||
mqtt_mock.async_publish.reset_mock()
|
||||
await common.async_turn_on(hass, "light.test", brightness=191)
|
||||
await hass.async_block_till_done()
|
||||
|
Reference in New Issue
Block a user