From 34a94ad72d44cb31e44990258488b1c0820f47ab Mon Sep 17 00:00:00 2001 From: LKuemmel Date: Wed, 4 Dec 2024 12:39:23 +0100 Subject: [PATCH] pv: fix submode change during switch on --- packages/control/chargepoint/chargepoint.py | 2 +- packages/control/counter.py | 1 + packages/control/ev.py | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/control/chargepoint/chargepoint.py b/packages/control/chargepoint/chargepoint.py index ce9d84aef0..ba12a10b2e 100644 --- a/packages/control/chargepoint/chargepoint.py +++ b/packages/control/chargepoint/chargepoint.py @@ -676,7 +676,7 @@ def update(self, ev_list: Dict[str, Ev]) -> None: self.set_timestamp_charge_start() self.check_phase_switch_completed() - if charging_ev.chargemode_changed: + if charging_ev.chargemode_changed or charging_ev.submode_changed: data.data.counter_all_data.get_evu_counter().reset_switch_on_off( self, charging_ev) charging_ev.reset_phase_switch(self.data.control_parameter) diff --git a/packages/control/counter.py b/packages/control/counter.py index 6a5079c55b..83b2f30fe9 100644 --- a/packages/control/counter.py +++ b/packages/control/counter.py @@ -492,6 +492,7 @@ def reset_switch_on_off(self, chargepoint: Chargepoint, charging_ev: Ev): else: evu_counter.data.set.released_surplus -= (pv_config.switch_on_threshold * chargepoint.data.control_parameter.phases) + chargepoint.data.control_parameter.state = ChargepointState.NO_CHARGING_ALLOWED except Exception: log.exception("Fehler im allgemeinen PV-Modul") diff --git a/packages/control/ev.py b/packages/control/ev.py index 32c54e0743..811a58e748 100644 --- a/packages/control/ev.py +++ b/packages/control/ev.py @@ -573,6 +573,7 @@ def reset_phase_switch(self, control_parameter: ControlParameter): log.debug( "Zurücksetzen der reservierten Leistung für die Phasenumschaltung. reservierte Leistung: " + str(data.data.counter_all_data.get_evu_counter().data.set.reserved_surplus)) + control_parameter.state = ChargepointState.CHARGING_ALLOWED def load_default_profile(self): """ prüft, ob nach dem Abstecken das Standardprofil geladen werden soll und lädt dieses ggf..