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 6cae031
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/test_switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -1623,11 +1623,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 6cae031

Please sign in to comment.