Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

start pv charging immediately after phase switch #1874

Merged
merged 1 commit into from
Sep 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions packages/control/chargepoint/chargepoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,9 +413,7 @@ def _is_phase_switch_required(self) -> bool:

STOP_CHARGING = ", dafür wird die Ladung unterbrochen."

def initiate_phase_switch(self):
"""prüft, ob eine Phasenumschaltung erforderlich ist und führt diese durch.
"""
def check_phase_switch_completed(self):
try:
evu_counter = data.data.counter_all_data.get_evu_counter()
charging_ev = self.data.set.charging_ev_data
Expand Down Expand Up @@ -455,6 +453,15 @@ def initiate_phase_switch(self):
if self.data.control_parameter.state == ChargepointState.WAIT_FOR_USING_PHASES:
if phase_switch.phase_switch_thread_alive(self.num) is False:
self.data.control_parameter.state = ChargepointState.CHARGING_ALLOWED
except Exception:
log.exception("Fehler in der Ladepunkt-Klasse von "+str(self.num))

def initiate_phase_switch(self):
"""prüft, ob eine Phasenumschaltung erforderlich ist und führt diese durch.
"""
try:
evu_counter = data.data.counter_all_data.get_evu_counter()
charging_ev = self.data.set.charging_ev_data
# Wenn noch kein Eintrag im Protokoll erstellt wurde, wurde noch nicht geladen und die Phase kann noch
# umgeschaltet werden.
if (not charging_ev.ev_template.data.prevent_phase_switch or
Expand Down Expand Up @@ -671,6 +678,7 @@ def update(self, ev_list: Dict[str, Ev]) -> None:
self.set_control_parameter(submode, required_current)
self.set_required_currents(required_current)
self.handle_less_power()
self.check_phase_switch_completed()

if charging_ev.chargemode_changed:
data.data.counter_all_data.get_evu_counter().reset_switch_on_off(
Expand Down