async def test_proactive_adaptation_transition_override(hass):
    """Validate that transitions in service calls are preferred over the default transition."""
    switch, (_, _, light3) = await setup_lights_and_switch(
        hass,
        {
            CONF_INTERCEPT: True,
            CONF_INITIAL_TRANSITION: 123,
        },
        True,
    )
    with patch.object(
        light3,
        "async_turn_on",
        wraps=light3.async_turn_on,
    ) as patched_async_turn_on:
        await hass.services.async_call(
            LIGHT_DOMAIN,
            SERVICE_TURN_ON,
            {ATTR_ENTITY_ID: ENTITY_LIGHT_3},
            blocking=True,
        )

        await hass.services.async_call(
            LIGHT_DOMAIN,
            SERVICE_TURN_ON,
            {ATTR_ENTITY_ID: ENTITY_LIGHT_3, ATTR_TRANSITION: 456},
            blocking=True,
        )
        await hass.async_block_till_done()

    # Assert that default is used when no transition is specified in service call
    assert patched_async_turn_on.call_args_list, patched_async_turn_on.call_args_list
    kwargs = patched_async_turn_on.call_args_list[0].kwargs
    assert set({ATTR_TRANSITION: 123}.items()).issubset(kwargs.items())

    # Assert that specified service call transition takes precedence over default
    kwargs = patched_async_turn_on.call_args_list[1].kwargs
    assert set({ATTR_TRANSITION: 456}.items()).issubset(kwargs.items())

    # Cleanup
    switch.manager.cancel_ongoing_adaptation_calls(ENTITY_LIGHT_3)
Validate that transitions in service calls are preferred over the default transition.
tests/test_switch.py