fix 1p3p phase switch - #3716
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes the 1p/3p phase switching retry behavior so repeated/failed phase switch attempts no longer lead to endless switching when retries are disabled (per #3589 / ticket context), and adds unit coverage for the involved decision logic.
Changes:
- Adjust
failed_phase_switches_reached()to stop further phase switching when retries are disabled and at least one failed switch has been recorded. - Add unit tests covering
hw_supports_phase_switch(),failed_phase_switches_reached(), andcp_state_hw_support_phase_switch().
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/control/chargepoint/chargepoint.py | Updates the “failed phase switches reached” decision to respect the retry-disabled setting based on failure count. |
| packages/control/chargepoint/get_phases_test.py | Adds test coverage for phase-switch capability and retry/limit gating logic. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+211
to
+214
| pytest.param(True, 3, True, id="retry-enabled-limit-reached"), | ||
| pytest.param(True, 2, False, id="retry-enabled-at-limit"), | ||
| pytest.param(False, 1, True, id="retry-disabled-failed"), | ||
| pytest.param(False, 0, False, id="retry-disabled-not-failed"), |
Comment on lines
+189
to
+193
| def test_hw_supports_phase_switch(cp: Chargepoint, | ||
| auto_phase_switch_hw: bool, | ||
| evse_signaling: str, | ||
| prevent_phase_switch: bool, | ||
| imported_since_plugged: float, |
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.
fix for #3589
Ticket #66006520; #3446 (comment)
Wiederholte Phasenumschaltung wird nicht beachtet und stattdessen unendlich oft umgeschaltet.
Wiederholte Umschaltung deaktiviert:
Wiederholte Umschaltung aktiviert, Fehlversuche nicht erreicht:
Wiederholte Umschaltung aktiviert, Fehlversuche erreicht:
Automatische Phasenumschaltung: