Skip to content

Add 91 classes missing from ocpp/v21/enums.py (fixes #774) - #776

Open
ugurcihan wants to merge 1 commit into
mobilityhouse:masterfrom
ugurcihan:fix/774-v21-missing-enums
Open

ugurcihan wants to merge 1 commit into
mobilityhouse:masterfrom
ugurcihan:fix/774-v21-missing-enums

Conversation

@ugurcihan

Copy link
Copy Markdown

Fixes #774.

Problem

ocpp/v21/enums.py (111 classes) is missing 91 classes that already exist in ocpp/v201/enums.py (176 classes) — including ControllerComponentName.aligned_data_ctrlr and its corresponding AlignedDataCtrlrVariableName enum, the exact example cited in #774.

Approach

Per the issue, these values are identical between the OCPP 2.0.1 and 2.1 CSV appendices (e.g. AlignedDataCtrlr appears with the same description in both components.csv files). Rather than re-transcribing 91 classes from the spec by hand — and risking introducing errors — this PR ports the missing classes directly from the already-reviewed ocpp/v201/enums.py, since it's an in-repo source of truth for the shared subset of the device model.

Each missing class is inserted alphabetically among v21's existing classes. No existing class was moved, reformatted, or otherwise touched — verified by diffing non-blank lines between the old and new file; the change is purely additive (0 lines removed).

Out of scope

Any OCPP 2.1-exclusive members that may exist within classes already shared between v201 and v21 (e.g. a new value added to an existing VariableName enum in the 2.1 spec) are not addressed here — sourcing those correctly needs the official 2.1 CSV appendices rather than a diff against v201. Happy to follow up on that separately if useful.

Testing

  • Added tests/v21/test_v21_enums.py as a regression test anchored to the exact gap reported in OCPP 2.1 enums are incomplete #774.
  • make tests (black, isort, flake8, pytest) passes clean: 186 passed.

ocpp/v21/enums.py was missing 91 classes that are present in
ocpp/v201/enums.py, including ControllerComponentName.aligned_data_ctrlr
and its corresponding AlignedDataCtrlrVariableName enum cited in mobilityhouse#774.

Per the issue, these values are identical between the OCPP 2.0.1 and 2.1
CSV appendices, so this PR ports the missing classes directly from the
already-reviewed ocpp/v201/enums.py rather than re-transcribing them from
the spec, to avoid introducing transcription errors. Each class is
inserted alphabetically among v21's existing classes; no existing class
was moved, reformatted, or otherwise touched (verified: zero non-blank
lines removed from the file).

Not in scope for this PR: any OCPP 2.1-exclusive members that may exist
*within* classes already shared between v201 and v21 (e.g. a new enum
value added to an existing VariableName type in the 2.1 spec) -- sourcing
those correctly needs the official 2.1 CSV appendices rather than a diff
against v201, and is left as potential follow-up work.

Added tests/v21/test_v21_enums.py as a regression test anchored to the
exact gap reported in the issue.

make tests (black, isort, flake8, pytest) passes clean: 186 passed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

OCPP 2.1 enums are incomplete

1 participant