Go to file
Krzysztof kuhy Rudnicki 32d0994ba6 Fire alarm daily, harden dismissal challenge; ignore wake_state.json
- _constants.py: ALARM_DAYS now every day (was Mon/Fri/Sat/Sun);
  DISMISS_CODE_LENGTH 8->10 and DISMISS_ROUNDS_REQUIRED 2->4 so
  dismissing forces staying awake longer.
- _challenges.py / _alarm.py: expanded dismissal challenge logic, with
  matching test updates.
- shutdown-wrapper.sh: updated hibernate/rtcwake wrapper.
- .gitignore: restore the missing rule for wake_alarm/wake_state.json
  (HMAC dismissal runtime state — must never be tracked, per CLAUDE.md).

Tests: 191 passed, 100% coverage.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RRCdR4D8SaVrN2xraMQxM
2026-07-10 23:14:40 +02:00
.github/workflows Extract wake_alarm from testsAndMisc as a standalone repo 2026-06-22 12:31:40 +02:00
scripts Extract wake_alarm from testsAndMisc as a standalone repo 2026-06-22 12:31:40 +02:00
wake_alarm Fire alarm daily, harden dismissal challenge; ignore wake_state.json 2026-07-10 23:14:40 +02:00
.gitignore Fire alarm daily, harden dismissal challenge; ignore wake_state.json 2026-07-10 23:14:40 +02:00
.pre-commit-config.yaml Point gatelock at the consolidated utils monorepo 2026-07-10 14:01:43 +02:00
CLAUDE.md Document the durable-clone editable-install requirement 2026-06-22 12:54:27 +02:00
install.sh Extract wake_alarm from testsAndMisc as a standalone repo 2026-06-22 12:31:40 +02:00
pyproject.toml Point gatelock at the consolidated utils monorepo 2026-07-10 14:01:43 +02:00
README.md Extract wake_alarm from testsAndMisc as a standalone repo 2026-06-22 12:31:40 +02:00
requirements.txt Point gatelock at the consolidated utils monorepo 2026-07-10 14:01:43 +02:00
shutdown-wrapper.sh Fire alarm daily, harden dismissal challenge; ignore wake_state.json 2026-07-10 23:14:40 +02:00
sleep-hook.sh Extract wake_alarm from testsAndMisc as a standalone repo 2026-06-22 12:31:40 +02:00
wake-alarm-fans.sh Extract wake_alarm from testsAndMisc as a standalone repo 2026-06-22 12:31:40 +02:00
wake-alarm.service Extract wake_alarm from testsAndMisc as a standalone repo 2026-06-22 12:31:40 +02:00

wake_alarm

A hibernate-scheduled weekend wake alarm: the machine hibernates overnight on alarm days and wakes itself via rtcwake, then shows a fullscreen, challenge-dismissed alarm with fan ramp and optional TP-Link Tapo P110 smart-plug control.

Install

bash install.sh

This installs the package + dependencies into system Python's user site-packages (the systemd service runs /usr/bin/python directly, not a venv — see CLAUDE.md), installs the systemd user service, the systemd-sleep resume hook, the shutdown wrapper that triggers hibernate on alarm nights, the fan-ramp script, and (optionally) python-kasa for smart-plug control.

Usage

python -m wake_alarm._alarm --demo   # test the alarm window (safe, closeable)

The alarm fires automatically via the hibernate/wake cycle once installed; no manual invocation is needed in normal operation.

Development

python -m venv .venv && .venv/bin/pip install -r requirements.txt
.venv/bin/pre-commit install && .venv/bin/pre-commit install --hook-type pre-push
.venv/bin/python -m pytest wake_alarm/tests/ --cov=wake_alarm --cov-branch --cov-fail-under=100

See CLAUDE.md for scheduling details, the hibernate/rtcwake mechanism, the cross-repo workout_log.json read, and production deployment gotchas.