Skip to content

feat: SimpliSafe live frame source with rejoin and blindness heartbeat - #32

Merged
pizzasaurusrex merged 4 commits into
mainfrom
feat/simplisafe-frame-source
Nov 13, 2026
Merged

pizzasaurusrex merged 4 commits into
mainfrom
feat/simplisafe-frame-source

Conversation

@pizzasaurusrex

Copy link
Copy Markdown
Owner

Summary

  • vision/live.py — LiveFrameSource: a camera-agnostic FrameSource given a function that opens a stream of BGR images. It owns a background thread/event loop, a newest-frame-only slot, and a rejoin loop keyed on frame arrival (30 s silence → close and reopen, backoff 2 s doubling to 60 s, forever). seconds_since_last_frame() is the health signal. Reusable for the production RTSP camera.
  • vision/simplisafe.py: bench-only adapter (ADR-002). Headless login from a rotating refresh token (vision/simplisafe_auth.py), live-view → LiveKit credentials, joins the room video-only. Deps in a new simplisafe extra; the core package never imports it.
  • Heartbeat: pure report_for_frame_age — UP is earned by fresh frames, DOWN after POOLGUARD_ALERT_BLIND_AFTER_SECONDS (180).
  • Commands: poolguard-simplisafe-login (one-time PKCE sign-in) and poolguard-simplisafe-watch (runs the source, logs fps per minute, pings Kuma).
  • Regression labels: retired YouTube clips replaced by six backyard clips from the real mount; drowning-test.mp4 (39 s, submersion at ~24 s) is the first labeled positive with a calm lead-in.
  • Decision log entries for the 2026-10-12 SimpliSafe measurements (two 90-min runs, battery, connection-state-is-not-health), PLAN and CLAUDE.md updated.

Test plan

  • uv run ruff check . && uv run ruff format --check .
  • uv run pytest with all extras — all pass locally
  • New tests (test_live_source, test_simplisafe_auth, test_simplisafe_watch_script) need neither livekit nor simplipy, so they run in CI
  • Live: poolguard-simplisafe-watch ~1 min at 1920x1080, 19–20 fps, clean shutdown
  • Live: rejoin against a real network outage (scripted-stream tests only so far)
  • Live: heartbeat UP/DOWN against the real Kuma monitor

@pizzasaurusrex
pizzasaurusrex merged commit 42fd161 into main Nov 13, 2026
1 check passed
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.

1 participant