feat(control): optional single-battery scope for manual hold#608
Draft
frahlg wants to merge 1 commit into
Draft
Conversation
frahlg
force-pushed
the
feat/single-battery-manual-hold
branch
from
July 22, 2026 05:24
9e95e08 to
a315acd
Compare
frahlg
force-pushed
the
feat/single-battery-manual-hold
branch
from
July 22, 2026 05:28
a315acd to
9480208
Compare
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.
Summary
manual_holdendpoint with an optionaldriverscope.driveron the existing pool path.Closes #607.
Relation to battery boost
This is not a battery-boost lease. Battery boost grants one loadpoint a short right to use the home battery pool and keeps the state needed for safe restart. This change adds a short service hold for one home battery and stores it only in memory. The two features share the core safety path. An active battery manual hold stops battery boost with the existing
battery_holdreason.API
POST /api/battery/manual_hold{ "direction": "charge", "power_w": 5000, "hold_s": 900, "driver": "bat_a" }Omit
driverfor the old pool behavior. The endpoint still limitshold_sto 1–1800 seconds.DELETE /api/battery/manual_holdstill stops the hold.Safety review
Automated tests
go test ./internal/control -run BatteryManualHold -count=1go test ./internal/api -run BatteryHold -count=1go test ./cmd/ftw -run 'Battery|DispatchBlock|SiteDispatchFreshness|StaleSiteDefault' -count=1npm test— 67 passedmake verifyafter rebasemake verify-all, including Linux ARM64, Linux AMD64, and Windows AMD64 buildsThe Go tests cover target scope, immediate sibling standdown with slew enabled, missing and changed hardware identity, unavailable targets, core power and reserve limits, and stale-site cancellation.
Field checklist
battery_hold.Keep this PR in draft until the field checks pass.