Skip to content

fix(control): end manual Charge at restart - #1869

Merged
frahlg merged 1 commit into
fix/fuse-one-functionfrom
codex/charge-restart-planning
Oct 27, 2026
Merged

frahlg merged 1 commit into
fix/fuse-one-functionfrom
codex/charge-restart-planning

Conversation

@frahlg

@frahlg frahlg commented Oct 27, 2026

Copy link
Copy Markdown
Member

A manual battery Charge must end when Core restarts. Previously FTW saved mode=charge, restored it at boot and resumed full-power charging even while the planner produced a separate plan.

Boot now replaces that override with the automatic mode for the saved battery export permission. If planning is disabled, it selects Idle. It saves the replacement and logs the change. Unknown export consent stays unknown; other stored modes keep their behavior. The HA bridge also ignores retained charge messages, which could otherwise replay the override on reconnect. Fresh Charge requests still work.

The planner already solves on startup. A regression test restores an archived plan and checks that Start creates a new decision using fresh SOC without waiting for the scheduled interval.

Validation:

  • Nine restart cases, each with two database close/reopen cycles, cover enabled/disabled planning, export permission precedence, unknown consent and dispatch while waiting for a plan. They failed before the fix.
  • MQTT tests cover retained Charge rejection, fresh Charge acceptance and other retained modes. The replay case failed before the fix.
  • Existing mode restoration tests now cover all seven other modes.
  • make verify passed. The first attempt timed out in the existing TestManagedDriverUpdateRecovery/save; that test then passed three isolated runs, followed by a passing full verify. Docker context and Avahi runtime checks skipped because Docker is unavailable.

Stacked on #1789 because it owns the startup/control files and already includes the SOC ceiling fix from #1867. This PR targets fix/fuse-one-function. No hardware test or site deployment.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-27T05:19:07.795526Z 013dd7a PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@frahlg
frahlg merged commit 1b36dbf into fix/fuse-one-function Oct 27, 2026
1 check passed
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.

1 participant