Skip to content

Refresh Ring-MQTT snapshots before saving - #4

Open
thomasgregg wants to merge 1 commit into
codex/ring-mqtt-activityfrom
codex/ring-mqtt-fresh-snapshots
Open

Refresh Ring-MQTT snapshots before saving#4
thomasgregg wants to merge 1 commit into
codex/ring-mqtt-activityfrom
codex/ring-mqtt-fresh-snapshots

Conversation

@thomasgregg

Copy link
Copy Markdown
Owner

Summary

Ensure the existing snapshot action saves a newly requested Ring-MQTT image instead of silently persisting a stale frame.

What changed

  • Identify the same-device Ring-MQTT Take Snapshot button through stable registry metadata, including renamed entities.
  • Require an unambiguous refresh control for a Ring-MQTT snapshot source.
  • Arm the state-update waiter before calling button.press.
  • Wait up to 15 seconds for the snapshot camera’s explicit timestamp attribute to change.
  • Call camera.snapshot only after the fresh image is published.
  • Cancel in-flight work when the viewer closes or changes mode.
  • Reuse the centered Ring View status treatment for timeout, permission, connection, camera, and filesystem failures.
  • Model the real MQTT snapshot/button relationship in the demo and browser suite.

Edge cases covered

  • Renamed snapshot cameras and buttons.
  • Disabled, missing, and ambiguous refresh buttons.
  • Slow or failed devices.
  • Service failures.
  • Viewer close or mode change during refresh.
  • Late state updates after cancellation.
  • Unavailable snapshot source with Live fallback.
  • Low-power devices that cannot capture while streaming.

The refresh is event-driven; it adds no polling fallback. A missing refresh control is an explicit error, never a false success with an old image.

Verification

  • npm test -- --run — 169 tests passed.
  • npm run check — passed.
  • npm run build — passed.
  • npm run test:browser — 112 tests passed on phone and desktop.
  • git diff --check — passed.

Stack

PR 3 of 5. Base: codex/ring-mqtt-activity.

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