async def test_two_switches_for_single_light(hass):
    """Test the case where someone has two switches for a single light.

    One switch for brightness and another for color.
    """
    extra_conf = {CONF_INTERCEPT: True}
    switch1, (light1, *_) = await setup_lights_and_switch(
        hass,
        extra_conf | {CONF_NAME: "switch1"},
        all_lights=True,
    )
    switch2, (light2, *_) = await setup_lights_and_switch(
        hass,
        extra_conf | {CONF_NAME: "switch2"},
        all_lights=True,
    )
    assert light1.entity_id == light2.entity_id

    # One switch controls brightness the other color
    await switch1.adapt_color_switch.async_turn_off()
    await switch2.adapt_brightness_switch.async_turn_off()

    assert switch1.adapt_brightness_switch.is_on
    assert switch2.adapt_color_switch.is_on

    async def turn_light(state, **kwargs):
        await hass.services.async_call(
            LIGHT_DOMAIN,
            SERVICE_TURN_ON if state else SERVICE_TURN_OFF,
            {ATTR_ENTITY_ID: ENTITY_LIGHT_1, **kwargs},
            blocking=True,
        )
        await hass.async_block_till_done()
        _LOGGER.debug("Turn light %s, to %s", state, kwargs)

    def increased_brightness():
        return (light1._attr_brightness + 100) % 255

    def increased_color_temp():
        return max(
            (light1._attr_color_temp + 100) % light1.max_color_temp_kelvin,
            light1.min_color_temp_kelvin,
        )

    assert light1.is_on
    await turn_light(True, brightness=increased_brightness())
    await turn_light(True, color_temp=increased_color_temp())

    attrs = hass.states.get(light1.entity_id).attributes
    before_brightness = attrs[ATTR_BRIGHTNESS]
    before_color_temp = attrs[ATTR_COLOR_TEMP_KELVIN]

    # Turn off "light1"
    await turn_light(False)

    # Turn on "light1"
    await turn_light(True)

    # Assert that the brightness and color temp have changed
    attrs = hass.states.get(light1.entity_id).attributes
    after_brightness = attrs[ATTR_BRIGHTNESS]
    after_color_temp = attrs[ATTR_COLOR_TEMP_KELVIN]
    assert before_brightness != after_brightness
    assert before_color_temp != after_color_temp
Test the case where someone has two switches for a single light.

    One switch for brightness and another for color.
    
tests/test_switch.py