Skip to content

Feature chargemode enums - #3825

Open
LKuemmel wants to merge 6 commits into
masterfrom
feature_chargemode_enums
Open

Feature chargemode enums#3825
LKuemmel wants to merge 6 commits into
masterfrom
feature_chargemode_enums

Conversation

@LKuemmel

Copy link
Copy Markdown
Contributor

No description provided.

@LKuemmel
LKuemmel requested a balanced review from Copilot August 20, 2026 06:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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},

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) uses typing.Dict, which is not valid for runtime isinstance checks in modern Python (will raise TypeError: isinstance() arg 2 must be a type). Use the concrete dict type here (and keep Dict only 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 a Chargemode, but the docstring section below still documents submode: 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 a ChargemodeEnum value as the second tuple element, but the return annotation is still Tuple[int, str, str]. This makes the type contract inconsistent with the rest of the module (which now returns ChargemodeEnum for 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 a Chargemode enum, but the docstring parameter description still says submode: 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
LKuemmel requested a lite review from Copilot August 20, 2026 08:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@LKuemmel
LKuemmel force-pushed the feature_chargemode_enums branch from 2620077 to 1bb8b40 Compare August 20, 2026 08:40
@LKuemmel
LKuemmel changed the base branch from feature_loadmanagement_prio_list to master August 20, 2026 08:45
@LKuemmel
LKuemmel marked this pull request as ready for review August 20, 2026 08:52
@LKuemmel
LKuemmel force-pushed the feature_chargemode_enums branch from 1bb8b40 to 3e1e495 Compare August 21, 2026 07:47
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.

2 participants