Conversation
POST /api/planner/prefs changes dispatch, so the phone writes safety_k and battery_export with planner.prefs.set. The box still maps that permission onto a planner mode. Signed-off-by: Cursor Agent <cursoragent@cursor.com>
5 of 6 tasks
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.
Contract-pair: srcfl/ftw-webapp@cursor/plan-household-prefs-1a28
Problem and result
The phone app needs to save the Plan card's household prefs.
GET /api/planner/prefsis already a read.POST /api/planner/prefsis actuation, so the session was refusing it withE_USE_CMDand no command to name.planner.prefs.setstoressafety_kandbattery_exportthrough the same write the HTTP route performs. The box maps that permission onto a planner mode and returns the stored factor. The caller does not choose the mode.planner_passive_arbitrageandplanner_arbitragestay in the mode catalogue. The dashboard hides those keys; Home Assistant still uses them.Paired with srcfl/ftw-webapp#76.
contract/registry.yamlis the same file in both.Scope and safety
The command uses
ftw.mode.writeand is not a dispatch write, same as changing the site mode: a sick meter must not lock the household out of holding more reserve. The plan that comes out of the prefs still meets the dispatch gate before anything moves.Open PRs #1474, #1470 and #1337 also touch
go/internal/api/api.go. This change addsVia(planner.prefs.set)on the existing prefs POST only.Verification
go test ./internal/appproto/ ./internal/api/ ./cmd/ftw -count=1 -run 'TestRegistry|TestPlannerPrefs|TestDoesNotExist'passed, which compiles the uplink wiring and runs the prefs command tests.No UI in this repository.
Checklist
go/internal/api/api.go.