Skip to content

Conversation

@basnijholt
Copy link
Owner

Summary

Bug Description

When separate_turn_on_commands: true is enabled and a light is turned off between the split brightness and color commands, the second command should be skipped. Currently it's not because:

  1. The proactive adaptation context is never cleared when light.turn_off is called
  2. This causes the off-check in _execute_adaptation_calls (switch.py:1337-1349) to be bypassed
  3. The second split command (color) is sent to an off light, turning it back on

Test plan

  • CI runs the test and it FAILS (confirming the bug exists)
  • After implementing the fix, CI runs the test and it PASSES

Related

Closes #1373 (after fix is implemented)

Regression test for #1373

This test verifies that when `separate_turn_on_commands: true` is enabled
and a light is turned off between split commands, the second command
should be skipped.

The bug occurs because the proactive adaptation context is never cleared
when `light.turn_off` is called, causing the off-check to be bypassed
in `_execute_adaptation_calls`.

This test currently FAILS (demonstrating the bug) and will PASS after
the fix is implemented.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Race condition with separate_turn_on_commands causes lights to show 'on at 0% brightness' after turn_off

1 participant