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(
        hass,
        {
            CONF_INTERCEPT: True,
            CONF_SEPARATE_TURN_ON_COMMANDS: True,
        },
        True,
    )

    _mock_sun_light_settings(
        switch,
        {
            ATTR_BRIGHTNESS_PCT: 67,
            ATTR_COLOR_TEMP_KELVIN: 3448,
            "force_rgb_color": False,
        },
    )

    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
    assert event_context_ids[0] == "test_context"
    assert is_our_context_id(event_context_ids[1])

    # Expect adapted light state
    state = hass.states.get(ENTITY_LIGHT_3)
    assert state.attributes[ATTR_BRIGHTNESS] == 171
    assert state.attributes[ATTR_COLOR_TEMP_KELVIN] == 3448
Validate that a split proactive adaptation yields one additional service call.
tests/test_switch.py