Skip to content

Commit

Permalink
Fix test_proactive_adaptation_with_separate_commands
Browse files Browse the repository at this point in the history
  • Loading branch information
basnijholt committed Jan 2, 2025
1 parent 69c3e35 commit f4f878b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/test_switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -1602,7 +1602,6 @@ async def test_proactive_adaptation(hass):
assert state.attributes[ATTR_COLOR_TEMP_KELVIN] == 3448


# TODO: Breaks since 2024.5.0!
async def test_proactive_adaptation_with_separate_commands(hass):
"""Validate that a split proactive adaptation yields one additional service call."""
switch, _ = await setup_lights_and_switch(
Expand All @@ -1623,11 +1622,16 @@ async def test_proactive_adaptation_with_separate_commands(hass):
},
)

event_context_ids = await _turn_on_and_track_event_contexts(
events = await _turn_on_and_track_event_contexts(
hass,
"test_context",
ENTITY_LIGHT_3,
return_full_events=True,
)
# Wait for all adaptation tasks to complete
await asyncio.gather(*switch.manager.adaptation_tasks)
await hass.async_block_till_done()
event_context_ids = [event.context.id for event in events]

# Expect two service calls
assert len(event_context_ids) == 2, event_context_ids
Expand Down

0 comments on commit f4f878b

Please sign in to comment.