Panels for a ten-inch screen, and a motor button that says where it is
Docs / docs (push) Canceled after 0s
Playwright Tests / test-playwright (1, 2) (push) Canceled after 0s
Playwright Tests / test-playwright (2, 2) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Test Backend / test-backend (push) Canceled after 0s
Compose Smoke Test / test-compose (push) Canceled after 0s
Playwright Tests / merge-reports (push) Canceled after 0s

Both screens the house is looked at on are 1280x800, so that is what the three
dashboards are laid out for: twelve columns of 96px, twelve rows of 51px, and
nothing past the bottom, because a panel does not scroll.

The motors are one control each instead of three buttons. A button could only
publish; a segmented control reads back as well — so the motor writes what it
is doing to the same message the control sets, and the segment that is held is
the direction it actually went. Up, Stop, Down for the shutters; Close/Open for
the window and In/Out for the awning, which is what those two are for.

A run stopped part way now leaves the position unknown rather than claiming the
target it never reached, so the next command in either direction moves it.

The preflight gained the two checks this needed. One runs each sample shape
past the port that would receive it. The other is arithmetic: every tile inside
the panel and none on top of another — both silent failures on a screen with no
scrollbar, and both caught before anything is written.

Sizes were settled by looking. A slider needs three rows or its tick labels
fall off; a status icon needs three or it loses the word under the glyph; a
gauge in two rows has no arc worth reading, so the battery is a bar on Home and
a gauge on Energy where there is height for one. A chart spends eighty pixels
on its chrome whatever it is given, so two of them read on this panel and three
did not — the temperature history is the one that went, and `history` still
answers for it.

`capture-panels.mjs` is how that was checked: the three panels at the screen's
own pixels, in both themes, reporting whether anything spilled.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-08-22 18:50:03 +02:00
co-authored by Claude Opus 5
parent 13cdfa79b9
commit 4bdc0ea04a
7 changed files with 341 additions and 100 deletions
+10 -2
View File
@@ -87,13 +87,13 @@ def process(cmd, state=None, up_s=26.0, down_s=28.0):
if cmd == STOP:
if not moving:
return None
run, run_for, target = STOP, 0.0, position
run, run_for, target = STOP, 0.0, ""
elif moving == cmd:
return None
elif moving:
# Reversing mid-travel drives both relays at once on the way past.
# Stop; the next command moves it.
run, run_for, target = STOP, 0.0, position
run, run_for, target = STOP, 0.0, ""
elif cmd == position:
return None
else:
@@ -104,9 +104,16 @@ def process(cmd, state=None, up_s=26.0, down_s=28.0):
return {
"run": run,
"run_for": run_for,
# Written back to the message the control publishes on, so one segmented
# button both sets the direction and shows which one it is doing — the
# same trick the arbiter uses. A run that was refused returns nothing at
# all, so the control keeps what the person put there.
"cmd": run,
"state": {
"moving": "" if run == STOP else run,
"moving_until": 0.0 if run == STOP else now + run_for,
# A run stopped part way is at no position anybody knows, so the
# next command in either direction has to be allowed to move it.
"position": target,
},
}
@@ -178,6 +185,7 @@ def motor(
"provides": [
{"name": run, "port": "run", "dtype": "str"},
{"name": run_for, "port": "run_for", "dtype": "float"},
{"name": cmd, "port": "cmd", "dtype": "str"},
{"name": state, "port": "state", "dtype": "record"},
],
}