Skip to content

feat(web): set a heat pump's curve offset from the Heating view - #749

Merged
frahlg merged 3 commits into
masterfrom
520-heating-control-ui
Aug 4, 2026
Merged

feat(web): set a heat pump's curve offset from the Heating view#749
frahlg merged 3 commits into
masterfrom
520-heating-control-ui

Conversation

@frahlg

@frahlg frahlg commented Jul 31, 2026

Copy link
Copy Markdown
Member

Built on merged #741 and #738.

Base: master at 369d120
Head: 5de3525

A pump whose driver declares a control gets a row on its Heating card. A pump that declares nothing keeps the existing telemetry view.

Changes

  • Render the control from the driver declaration: label, bounds, step, unit and evidence.
  • Keep the Auto label when no hold is active, but base the first absolute step on hp_z1_heat_offset or hp_heating_offset_climate_system_1. Disable the stepper when no current reported offset exists instead of assuming zero; an active hold is shown separately and never becomes the fallback start value.
  • Serialize one in-flight request per driver/control. Both stepper directions, rerendered buttons and release are closed while the POST/DELETE and its follow-up refresh settle; the event handler also rejects duplicate requests defensively. A failed request closes through error handling and then permits a later retry.
  • Queue one refresh requested during an in-flight refresh and run it after the current cycle settles, including the error path.
  • Remove generated driver cache JSON files, go/state.db.clean and go/state.db.snapshot. Ignore the runtime cache and DB snapshot paths.

Verification

All three original review threads are resolved: observed offset start, queued refresh, and generated artifacts. This head also includes the independent rereview fixes for the persistent in-flight control gate and fail-closed telemetry requirement.

A driver-specific controls block remains a follow-up in srcfl/device-drivers.

@frahlg
frahlg requested a review from erikarenhill as a code owner July 31, 2026 17:45

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 99690233ba

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread web/heating.js Outdated
Comment thread web/heating.js Outdated
Comment thread go/driver-repository/cache/ftw-official-beta.json Outdated

@miravoss26 miravoss26 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.

Adds a heat-pump curve-offset control to the Heating view, rendered entirely from the driver's declaration and wired to the operator control-hold endpoint (POST/DELETE /api/drivers/{name}/control) from #741.

What I checked:

  • Every driver-derived string is escaped: escapeHtml on the name, control id, value and aria-label in the rendered HTML, and encodeURIComponent(name) on the fetch path. No XSS or path-injection surface.
  • Declaration-driven: nothing keys on a driver name (a test asserts the control section never names heishamon/myuplink/nibe), a pump that declares nothing renders nothing, and bounds/step/unit come from the declaration. It clamps to the declared min/max for the button-disable state; the server (#741) clamps authoritatively.
  • "Auto" when there's no hold rather than printing a 0 it doesn't know; held state carried by text and weight, not colour (deuteranopia); a write_ack driver says "does not confirm this setting". All tested (9 tests).
  • stopPropagation so commanding the pump doesn't open the detail drill-in, and refreshAfterControl so a press shows its result mid-30s-refresh.

One question, not a blocker: the PR also adds go/state.db.clean (empty), go/state.db.snapshot (binary), and two go/driver-repository/cache/*.json files. Are those intended committed fixtures, or leftovers from a local run? Worth a glance before merge.

Safe to merge from my read. Not in my auto-merge allowlist, so a human merges.

@frahlg
frahlg force-pushed the 520-driver-control-path branch 3 times, most recently from f877ae1 to ccd65a3 Compare August 4, 2026 09:02
@frahlg
frahlg force-pushed the 520-driver-control-path branch 4 times, most recently from 9ccb928 to ecabb30 Compare August 4, 2026 12:54
@frahlg
frahlg force-pushed the 520-heating-control-ui branch 2 times, most recently from 32f871d to e911cc6 Compare August 4, 2026 13:02
@frahlg
frahlg changed the base branch from 520-driver-control-path to master August 4, 2026 13:02
@frahlg
frahlg force-pushed the 520-heating-control-ui branch from e911cc6 to b7faedf Compare August 4, 2026 13:05
frahlg and others added 2 commits August 4, 2026 15:10
A pump whose driver declares a control gets a row on its card: the value in
force, when the hold ends, and buttons to move or release it. A pump that
declares nothing looks exactly as it did.

On the Heating card rather than Settings → Devices, because that is where the
pump's own state already is — the offset sits next to the temperatures it
moves. Settings is for connecting a device, not running it.

Rendered entirely from the declaration; nothing here knows a driver by name.
Stepper buttons rather than a slider or number field: the card is re-rendered
wholesale every 30 s and a control holding input state would lose a half-typed
value on every refresh. Control clicks stop propagating, or the card — which
is itself a button into the all-signals view — opens over the thing the
operator just pressed.

With no hold the row reads "Auto" rather than 0: nothing in the browser knows
what offset the pump settled on internally. Held state is carried by text and
weight, never colour, since the theme's green/red pair is not separable under
deuteranopia. A driver declaring write_ack rather than readback says so in the
row.

Verified against a running FTW with a probe driver: pressing + drove the
driver's own hp_z1_heat_offset to 1, raise disabled at the declared +3,
Release returned it to 0 through driver_default_mode, and a control click did
not open the detail view while a card click still did.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@frahlg
frahlg force-pushed the 520-heating-control-ui branch from b7faedf to c9dfd43 Compare August 4, 2026 13:13
@frahlg
frahlg merged commit 31232f2 into master Aug 4, 2026
13 checks passed
@frahlg
frahlg deleted the 520-heating-control-ui branch August 8, 2026 05:22
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