mirror of
https://github.com/home-assistant/core.git
synced 2026-09-27 18:08:37 -04:00
Always request at least one zone for multi-zone LIFX devices (#92683)
This commit is contained in:
@@ -1754,6 +1754,8 @@ async def test_light_strip_zones_not_populated_yet(hass: HomeAssistant) -> None:
|
||||
bulb.power_level = 65535
|
||||
bulb.color_zones = None
|
||||
bulb.color = [65535, 65535, 65535, 65535]
|
||||
assert bulb.get_color_zones.calls == []
|
||||
|
||||
with _patch_discovery(device=bulb), _patch_config_flow_try_connect(
|
||||
device=bulb
|
||||
), _patch_device(device=bulb):
|
||||
@@ -1761,6 +1763,14 @@ async def test_light_strip_zones_not_populated_yet(hass: HomeAssistant) -> None:
|
||||
await hass.async_block_till_done()
|
||||
|
||||
entity_id = "light.my_bulb"
|
||||
# Make sure we at least try to fetch the first zone
|
||||
# to ensure we populate the zones from the 503 response
|
||||
assert len(bulb.get_color_zones.calls) == 3
|
||||
# Once to populate the number of zones
|
||||
assert bulb.get_color_zones.calls[0][1]["start_index"] == 0
|
||||
# Again once we know the number of zones
|
||||
assert bulb.get_color_zones.calls[1][1]["start_index"] == 0
|
||||
assert bulb.get_color_zones.calls[2][1]["start_index"] == 8
|
||||
|
||||
state = hass.states.get(entity_id)
|
||||
assert state.state == "on"
|
||||
|
||||
Reference in New Issue
Block a user