Encode battery charge source in action states - #13
Merged
Conversation
LordMike
force-pushed
the
codex/battery-action-source-states
branch
from
April 15, 2026 07:54
4189427 to
e53e170
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
This PR changes battery action states so they encode charge source directly in the public contract instead of exposing a generic
chargestate plus a separatecharge_sourcefield.It changes battery schedule/action outputs from:
charge+charge_source=grid|pv|grid_pvto:
charge_gridcharge_pvcharge_grid_pvholdanddischargeremain unchanged.What this changes
charge_sourceattribute/field from:plan_detailsbattery action codes to preserve source information:c_gc_pc_gpdhprojection.pyto join multiple non-hold compact action codes with+to avoid ambiguous stringsTests
Validated with targeted pytest runs:
tests/optimizer/test_optimizer_scenarios.pytests/integration/test_integration_runtime.pytests/integration/test_integration_e2e.pyResult:
61 passedDocs
Updates entity/service and optimizer API docs to reflect the new battery action contract and compact action encoding.
Notes
charge_sourceas a legacy field; tests assert the positive contract only_charge_source_permissionsunchanged because it is not part of the public API