Skip to content

Commit

Permalink
update soc if new soc from cp is available (#1983)
Browse files Browse the repository at this point in the history
  • Loading branch information
LKuemmel authored Oct 30, 2024
1 parent f6438f2 commit 2c41711
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
3 changes: 2 additions & 1 deletion packages/control/chargepoint/chargepoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,8 @@ def update(self, ev_list: Dict[str, Ev]) -> None:
"/set/ocpp_transaction_id", self.data.set.ocpp_transaction_id)
# SoC nach Anstecken aktualisieren
if ((self.data.get.plug_state and self.data.set.plug_state_prev is False) or
(self.data.get.plug_state is False and self.data.set.plug_state_prev)):
(self.data.get.plug_state is False and self.data.set.plug_state_prev) or
(self.data.get.soc_timestamp > self.data.set.charging_ev_data.data.get.soc_timestamp)):
Pub().pub(f"openWB/set/vehicle/{self.data.config.ev}/get/force_soc_update", True)
log.debug("SoC nach Anstecken")
self.set_state_and_log(message)
Expand Down
4 changes: 0 additions & 4 deletions packages/modules/update_soc.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,9 @@ def _get_vehicle_update_data(self, ev_num: int) -> VehicleUpdateData:
if ev.soc_module.general_config.use_soc_from_cp:
soc_from_cp = cp.data.get.soc
timestamp_soc_from_cp = cp.data.get.soc_timestamp
log.debug(f"cp.num {cp.num} cp.data.get {cp.data.get}")
log.debug(f"1 soc_from_cp: {soc_from_cp}, timestamp_soc_from_cp: {timestamp_soc_from_cp}")
else:
soc_from_cp = None
timestamp_soc_from_cp = None
log.debug(f"2 soc_from_cp: {soc_from_cp}, timestamp_soc_from_cp: {timestamp_soc_from_cp}")
break
else:
plug_state = False
Expand All @@ -118,7 +115,6 @@ def _get_vehicle_update_data(self, ev_num: int) -> VehicleUpdateData:
efficiency = ev_template.data.efficiency
soc_from_cp = None
timestamp_soc_from_cp = None
log.debug(f"3 soc_from_cp: {soc_from_cp}, timestamp_soc_from_cp: {timestamp_soc_from_cp}")
return VehicleUpdateData(plug_state=plug_state,
charge_state=charge_state,
efficiency=efficiency,
Expand Down

0 comments on commit 2c41711

Please sign in to comment.