retry failed phase switches: no retry switch if disabled#3589
Open
LKuemmel wants to merge 5 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
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): |
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.
Ticket #66004879
Wiederholte Phasenumschaltung wird nicht beachtet und stattdessen unendlich oft umgeschaltet.
Wiederholte Umschaltung deaktiviert:
Wiederholte Umschaltung aktiviert, Fehlversuche nicht erreicht:
Wiederholte Umschaltung aktiviert, Fehlversuche erreicht: