Skip to content

fix 1p3p phase switch - #3716

Merged
LKuemmel merged 4 commits into
openWB:masterfrom
LKuemmel:fix_failed_phase_switches
Jul 27, 2026
Merged

fix 1p3p phase switch#3716
LKuemmel merged 4 commits into
openWB:masterfrom
LKuemmel:fix_failed_phase_switches

Conversation

@LKuemmel

@LKuemmel LKuemmel commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

fix for #3589

Ticket #66006520; #3446 (comment)

Wiederholte Phasenumschaltung wird nicht beachtet und stattdessen unendlich oft umgeschaltet.

Wiederholte Umschaltung deaktiviert:

  • Umschaltung vor Ladestart
  • Ladestart ohne Umschaltung
  • Ladestart mit falscher Phasenzahl
  • Umschaltung während der Ladung vom Lademodus

Wiederholte Umschaltung aktiviert, Fehlversuche nicht erreicht:

  • Umschaltung vor Ladestart
  • Ladestart ohne Umschaltung
  • Ladestart mit falscher Phasenzahl
  • Umschaltung während der Ladung vom Lademodus

Wiederholte Umschaltung aktiviert, Fehlversuche erreicht:

  • Ladestart mit falscher Phasenzahl: schaltet nicht um
  • Umschaltung während der Ladung vom Lademodus: schaltet um

Automatische Phasenumschaltung:

  • 1p3p
  • 3p1p

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

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(), and cp_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,
@LKuemmel
LKuemmel merged commit 824a08f into openWB:master Jul 27, 2026
1 check passed
@LKuemmel
LKuemmel deleted the fix_failed_phase_switches branch July 27, 2026 10:39
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