Skip to content

Commit

Permalink
pv: fix submode change during switch on
Browse files Browse the repository at this point in the history
  • Loading branch information
LKuemmel committed Dec 17, 2024
1 parent 76effac commit 34a94ad
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/control/chargepoint/chargepoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions packages/control/counter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
1 change: 1 addition & 0 deletions packages/control/ev.py
Original file line number Diff line number Diff line change
Expand Up @@ -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..
Expand Down

0 comments on commit 34a94ad

Please sign in to comment.