Repository navigation
Fix OCPP 2.1 SoC/SoH serialization for schema-specific wire keys - #796
Open
VolMax-Studio wants to merge 1 commit into
Open
VolMax-Studio wants to merge 1 commit into
VolMax-Studio wants to merge 1 commit into
Conversation
Signed-off-by: VolMax-Studio <volmax.core@gmail.com>
VolMax-Studio
requested review from
OSkrk,
mdwcrft and
proelke
as code owners
November 17, 2026 21:37
Merged
mdwcrft
added a commit
that referenced
this pull request
Nov 28, 2026
### Changes included in this PR Bumps versions and changelog for the 2.2.0 release. - `pyproject.toml` and `docs/source/conf.py`: `2.2.0rc2` → `2.2.0` - `CHANGELOG.md`: new `2.2.0` section, identical to `2.2.0-rc.2`. Nothing has merged since rc2, and no regressions have been reported against it. Open PRs #795, #796 and #797 and issue #798 are deliberately left out. They fix problems that already exist in 2.1.0 and are planned for 2.2.1. ### After merge Tag the merge commit `2.2.0`, then create the GitHub release (not a pre-release). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.
Changes included in this PR
Bug fix for schema-specific SoC/SoH JSON wire-key casing in outgoing OCPP 2.1 payloads.
BatteryDataType(soC,soH) andLimitAtSoCType(soc).fullSoC,bulkSoC,maxSoC,targetSoCand other keys.ChargePoint.call()regression coverage, including nested dictionaries and compatibility cases.Current behavior
For
BatterySwaprequests,BatteryDataTypefieldssocandsohare serialized asSoC/sohinstead of the schema-requiredsoC/soH. ForLimitAtSoCType(e.g.SetChargingProfile),socis serialized asSoCinstead ofsoc. OCPP 2.1 schema validation rejects these requests withFormatViolationErrorbefore they are sent.Both failures were reproduced on current
master(dad5896ac92e3dca8f9e7f19ba09d216b0d07fa5); five targeted test cases fail without the fix.Related historic casing fixes: #523 and #601, addressing other contexts.
New behavior
Correct wire keys are emitted using the originating dataclass or enclosing schema-property context. Existing conversion behavior remains for unrelated fields. A standalone plain dictionary with no context retains the legacy conversion fallback.
Impact
No public function signatures or wire schemas are changed. This fix changes previously invalid outgoing wire keys to the spellings required by OCPP 2.1. No migration is expected for conforming callers.
Checklist
Local verification (Python 3.12): complete
pytest -qsuite 193 passed (including async and Hypothesis tests);black --check,isort --check-only,flake8on changed files passed;mypy --strict --follow-imports=silentforocpp/charge_point.pypassed. Upstream CI is separate and has not yet run.