Keep the LED on when a blink gives way to a steady level #7
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/led-blink-cancel-clobber"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
On a real Pi, ending a call left the on-board LED dark even though the state was
SOLID:…but the LED was physically off.
Why
set_state -> _apply(SOLID)cancels the running blink task and then writes the steady brightness (1) synchronously. But_cancel_blink()only schedules the cancellation — the blink coroutine'sexcept asyncio.CancelledError: self._write_brightness(0)cleanup runs a loop turn later, landing after the SOLID1and clobbering it back to0. Dev mode hid it because sysfs writes are no-ops there.Change
_write_brightness(0)from_slow_blink/_double_blip. The steady level after a blink is always set by whoever cancels it —_apply's driver (OFF/SOLID/next blink) orstop()— so the cleanup write was redundant as well as racy.DOUBLE_BLIP -> SOLIDand asserting the final brightness write is1. Verified it fails (assert 0 == 1) against the old ordering and passes with the fix.🤖 Generated with Claude Code