mirror of
https://github.com/basnijholt/adaptive-lighting.git
synced 2026-09-17 17:24:03 +02:00
Add test_expand_light_groups (#319)
* Add test_expand_light_groups * Add imports * import --------- Co-authored-by: Benjamin Auquite <halomastar@gmail.com>
This commit is contained in:
parent
4c1140c517
commit
187185698e
1 changed files with 14 additions and 0 deletions
|
|
@ -71,6 +71,7 @@ from homeassistant.components.adaptive_lighting.switch import (
|
|||
AdaptiveSwitch,
|
||||
SimpleSwitch,
|
||||
_attributes_have_changed,
|
||||
_expand_light_groups,
|
||||
color_difference_redmean,
|
||||
create_context,
|
||||
is_our_context,
|
||||
|
|
@ -2551,6 +2552,19 @@ def test_lerp_color_hsv():
|
|||
lerp_color_hsv((255, 0, 0), (0, 255, 0), 1.1)
|
||||
|
||||
|
||||
async def test_expand_light_groups_waits_for_group_state(hass):
|
||||
"""Test expansion waits until a light group's state is available."""
|
||||
await setup_switch(hass, {})
|
||||
group = "light.pending_group"
|
||||
members = ["light.light_1", "light.light_2"]
|
||||
|
||||
assert _expand_light_groups(hass, [group]) == [group]
|
||||
|
||||
hass.states.async_set(group, STATE_ON, {ATTR_ENTITY_ID: members})
|
||||
|
||||
assert _expand_light_groups(hass, [group]) == members
|
||||
|
||||
|
||||
@pytest.mark.parametrize("proactive_service_call_adaptation", [True, False])
|
||||
@pytest.mark.parametrize("take_over_control", [True, False])
|
||||
@pytest.mark.parametrize("multi_light_intercept", [True, False])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue