Repository navigation
fix(web): switching the import ceiling on applies the box's last value (#1674) - #1703
Merged
Merged
Conversation
#1674) The Grid dialog posted the ceiling from the browser's localStorage when the toggle went on. Göran's browser held 3,000 W from a test, so the box applied 3,000 W instead of the 7,500 W he meant and his car stopped. The box now keeps the last ceiling that was on and serves it in /api/status as peak_import_ceiling_last_w. The page shows and applies that value. A box that never had a ceiling on applies nothing until Save, and Save in the dialog now looks off while disabled. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
frahlg
marked this pull request as ready for review
October 17, 2026 15:20
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 09253952b3
ℹ️ 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".
POST /api/peak_import_ceiling changed the live ceiling and answered 200 even when saving it failed, so a restart could bring back the old one. It now saves first and answers 500, leaving the ceiling as it was. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On 17 October 2026 Göran (#1674, v0.147.2-beta.1, Easee Cloud + Pixii, 25 A three-phase) switched on the peak import limit meaning 7,500 W. The box applied 3,000 W at once (log 14:22:24Z: grid 12,823 W, overage 9,823 W) and his car stopped.
The on-box page posted
/api/peak_import_ceilingstraight away withreadLastPeakLimitW(): the last value in that browser's localStorage (ftw-peak-import-ceiling-w, default 5,000). His browser still held 3,000 W from a test the night before. The box is the record, so a tariff limit must not come from browser storage.Change
POST /api/peak_import_ceilingalso savespeak_import_ceiling_last_w: the new value when it is above 0, otherwise the ceiling that was on before. The second case covers a ceiling set by an older Core, which stored no last value./api/statusservespeak_import_ceiling_last_w: the ceiling while on, the stored one while off,nullif none was ever on..slider-group-compact, dims it while disabled. It also dims the grid target's Save while the planner drives.go/internal/controlis untouched; the EV guard changes there run in #1699 and the thermal budget branch.Overlap
handleSetPeakImportCeiling, adds two status fields afterpv_surplus_absorb_soc_cap, and appends a test toapi_peak_limit_test.go. This branch leaves those lines alone and uses its own test file. A trial merge with the head of fix(control): the import ceiling caps each clock hour's mean import (#1674) #1699 (4d993623) has no conflicts.ceilingW. The new field is not incontract/registry.yaml. No paired PR is needed.Evidence
go/internal/api/api_peak_import_ceiling_test.go: on, off, off again, and a restart on the samestate.dbkeep 7,500 W as the last value. A ceiling of 6,000 W set before this change survives switching off.web/peak-import-ceiling.test.mjsruns the realapp.jsin a VM, with 3,000 in localStorage. Switching on posts 7,500 (the box's value). With no box value it posts nothing until Save. Off posts 0. Against master'sapp.js, the first two tests fail and post 3,000.ftw-peak-import-ceiling-w = 3000in localStorage:make verify: green.A person should still look at the Grid dialog before merge.
🤖 Generated with Claude Code