Skip to content

Lock the website after unclear replies and keep panel loops running - #4

Closed
diyanko wants to merge 1 commit into
experiment/fresh-pi-setup-20261013from
fix/website-receipts-and-steady-loops
Closed

diyanko wants to merge 1 commit into
experiment/fresh-pi-setup-20261013from
fix/website-receipts-and-steady-loops

Conversation

@diyanko

@diyanko diyanko commented Oct 23, 2026

Copy link
Copy Markdown
Member

What changes for room users

  • Website: a "receipt unknown" reply from the panel (HTTP 503) now locks controls and watches for the panel's receipt, the same as a lost reply. Before, it was shown as an ordinary refusal and buttons stayed active, so a power request could be sent twice.
  • Panel: the clock, theme switching and website bridge keep running if one step hits an unexpected error (logged once to the panel log). The website's status sampler also keeps sampling after any error.
  • After a failed restart/shutdown: the panel and website now say power controls stay off until the panel restarts, and (when lighting was handed back) to open Legacy, then Home, to reconnect lighting.

Simpler

  • Guide/help text reaches the website only from room-content.json (generated from the panel's text and already checked by test_shared_content). The live snapshot polled every second no longer repeats ~12 KB of it; the website retries loading the file if the first load fails.
  • serve.py --timezone for weather (default unchanged), journal closed on the wrong-screen-size exit, utcnow() replaced.

Not changed

No lighting adapter, light state machine (poll_worker) or power sequence logic. The website's private IP in room_controls.py/QR image stays: removing it needs a runtime QR generator, which means a new package on the Pi.

Checks

  • python -m pytest tests: 99 passed, 2 skipped (Pillow not installed on the review PC). New tests cover the loop helper and the slimmer snapshot.
  • node --check browser/room.js
  • Not yet checked on the room Pi or in a live browser with the panel connected.

🤖 Generated with Claude Code

Room users:
- The website now treats a "receipt unknown" reply from the panel like a lost
  reply: it locks controls and watches for the panel's receipt instead of
  inviting a repeat (including power requests).
- The panel clock, theme switching and website bridge keep running if one
  reading fails; the error is logged once. The website status sampler likewise
  never stops.
- After a failed restart/shutdown the panel says power controls stay off until
  it restarts, and how to reconnect lighting.

Simpler:
- Guide/help text reaches the website only through room-content.json (already
  generated and tested against the panel), not in every live snapshot.
- serve.py takes --timezone for weather (same default); journal closes on the
  wrong-screen exit; utcnow() replaced.

No lighting adapter, light state machine or power sequence logic changed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 23, 2026 05:10

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@diyanko

diyanko commented Nov 10, 2026

Copy link
Copy Markdown
Member Author

Superseded by #6, which carries this history forward as one release PR to main.

@diyanko diyanko closed this Nov 10, 2026
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.

2 participants