Skip to content

retry failed phase switches: no retry switch if disabled#3589

Open
LKuemmel wants to merge 5 commits into
openWB:masterfrom
LKuemmel:fix_failed_phase_switches
Open

retry failed phase switches: no retry switch if disabled#3589
LKuemmel wants to merge 5 commits into
openWB:masterfrom
LKuemmel:fix_failed_phase_switches

Conversation

@LKuemmel

Copy link
Copy Markdown
Contributor

Ticket #66004879

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

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

This PR addresses Ticket #66004879 by preventing endless phase-switch retries and making phase-switch retry behavior dependent on the retry_failed_phase_switches setting.

Changes:

  • Refactors _is_phase_switch_required() to use early returns and gate “corrective” phase switching based on the retry/failed-switch conditions.
  • Adjusts phase-switch completion handling and related phase selection logic to align with the new retry gating.
  • Updates integration test setup to explicitly enable retry_failed_phase_switches.

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 Reworks phase-switch decision flow and introduces retry/failed-switch gating via failed_phase_switches_reached().
packages/control/algorithm/integration_test/conftest.py Sets retry_failed_phase_switches = True for integration tests to ensure consistent behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +823 to 827
if (data.data.general_data.data.chargemode_config.pv_charging.retry_failed_phase_switches and
self.data.control_parameter.failed_phase_switches > self.MAX_FAILED_PHASE_SWITCHES):
# bei deaktiverter Wiederholung der Umschaltung nur den gewünschten Umschaltvorgang durchführen,
# keinen Korrekturversuch
self.set_state_and_log(
Comment on lines +823 to +824
if (data.data.general_data.data.chargemode_config.pv_charging.retry_failed_phase_switches and
self.data.control_parameter.failed_phase_switches > self.MAX_FAILED_PHASE_SWITCHES):
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