mirror of
https://github.com/kuhyx/wake-alarm.git
synced 2026-11-12 08:51:03 +01:00
Two spots blocked the alarm on a timer, guessing when the monitor's HDMI sink would be "ready": - _activate_all_outputs polled _list_real_sinks in a loop with time.sleep, waiting up to 20s for ALARM_AUDIO_SINK to appear. - main() slept DISPLAY_WAKE_WAIT_SECONDS (5s) after waking the display before audio setup. Both are gone. Activation now forces every card's output profile on and activates whatever sink is present at that instant; the beep loop's _play_on_all_sinks already re-lists real sinks every cycle, so a slow monitor is swept in the moment it actually enumerates — a real presence check, never a timed guess. main() wakes the display and proceeds immediately; the monitor powers on in parallel. Removes now-dead constants ALARM_AUDIO_CARD, ALARM_AUDIO_PROFILE, ALARM_AUDIO_SINK_WAIT_SECONDS, ALARM_AUDIO_SINK_POLL_SECONDS, DISPLAY_WAKE_WAIT_SECONDS. Activation returns in ~0.26s (was up to 20s); the test suite drops from ~12s to ~2s (two main() tests were each really sleeping 5s). 100% branch coverage retained. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018SJ6HYXhBmYs3SiGBZv1rF |
||
|---|---|---|
| .. | ||
| tests | ||
| __init__.py | ||
| _alarm_display.py | ||
| _alarm.py | ||
| _audio.py | ||
| _challenges.py | ||
| _constants.py | ||
| _logging_setup.py | ||
| _sinks.py | ||
| _smart_plug.py | ||
| _state.py | ||