Feature chargemode enums - #3825
Open
LKuemmel wants to merge 6 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 62 out of 62 changed files in this pull request and generated no new comments.
Suppressed comments (2)
packages/helpermodules/create_debug.py:116
- The debug output section header still says "General Charge Config/ PV" but the values now come from the new surplus/bat chargemode_config sections. This makes the generated debug report misleading; consider renaming the header to reflect the new config structure (e.g., "Surplus/Battery").
packages/control/counter_all/loadmanagement_prio_test.py:35 - Typo in the pytest param id: "emtpy list" should be "empty list" to keep test metadata readable/searchable.
"loadmanagement_prios, id, type, expected_loadmanagement_prios",
[
pytest.param([], 2, "vehicle", [{"type": "vehicle", "id": 2}], id="emtpy list"),
pytest.param([{"type": "vehicle", "id": 3}], 2, "vehicle", [{"type": "vehicle", "id": 3},
LKuemmel
force-pushed
the
feature_chargemode_enums
branch
from
August 20, 2026 06:50
eafdcf2 to
5ef2745
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.
Suppressed comments (4)
packages/helpermodules/subdata.py:257
isinstance(..., Dict)/isinstance(..., Dict)usestyping.Dict, which is not valid for runtimeisinstancechecks in modern Python (will raiseTypeError: isinstance() arg 2 must be a type). Use the concretedicttype here (and keepDictonly for type hints).
payload = decode_payload(msg.payload)
if isinstance(payload, Dict):
for key, value in payload.items():
setattr(class_obj, key, value)
elif isinstance(getattr(class_obj, key, None), Enum):
setattr(class_obj, key, type(getattr(class_obj, key))(payload))
else:
setattr(class_obj, key, decode_payload(msg.payload))
else:
if isinstance(class_obj, Dict):
if key in class_obj:
packages/control/ev/ev.py:144
get_required_current()return type was updated to return aChargemode, but the docstring section below still documentssubmode: str. Updating the docstring to match the enum-based API would prevent confusion and incorrect downstream usage.
charge_state: bool) -> Tuple[bool, Optional[str], Chargemode, float, int]:
""" ermittelt, ob und mit welchem Strom das EV geladen werden soll (unabhängig vom Lastmanagement)
Parameter
---------
imported_since_mode_switch: float
seit dem letzten Lademodi-Wechsel geladene Energie.
Return
------
state: bool
Soll geladen werden?
message: str
Nachricht, warum nicht geladen werden soll
submode: str
Lademodus, in dem tatsächlich geladen wird
required_current: int
packages/control/ev/charge_template.py:713
stop()now returns aChargemodeEnumvalue as the second tuple element, but the return annotation is stillTuple[int, str, str]. This makes the type contract inconsistent with the rest of the module (which now returnsChargemodeEnumfor submodes) and can mislead callers/type checkers.
def stop(self) -> Tuple[int, str, str]:
return 0, ChargemodeEnum.STOP, "Keine Ladung, da der Lademodus Stop aktiv ist."
packages/control/chargepoint/chargepoint.py:228
set_control_parameter()now takes aChargemodeenum, but the docstring parameter description still sayssubmode: str. Please update the docstring to reflect the enum type so the public contract stays clear.
def set_control_parameter(self, submode: Chargemode):
""" setzt die Regel-Parameter, die der Algorithmus verwendet.
Parameter
---------
submode: str
neuer Lademodus, in dem geladen werden soll
"""
LKuemmel
force-pushed
the
feature_chargemode_enums
branch
from
August 20, 2026 08:40
2620077 to
1bb8b40
Compare
LKuemmel
changed the base branch from
feature_loadmanagement_prio_list
to
master
August 20, 2026 08:45
LKuemmel
marked this pull request as ready for review
August 20, 2026 08:52
LKuemmel
force-pushed
the
feature_chargemode_enums
branch
from
August 21, 2026 07:47
1bb8b40 to
3e1e495
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.
No description provided.