From 323f0634b3531f61b308372cb162ad83489f54d1 Mon Sep 17 00:00:00 2001 From: pietfried Date: Wed, 7 Aug 2024 17:56:52 +0200 Subject: [PATCH] moving add_stop_enegry_wh Signed-off-by: pietfried --- lib/ocpp/v16/charge_point_impl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ocpp/v16/charge_point_impl.cpp b/lib/ocpp/v16/charge_point_impl.cpp index 5b704dd49..1ebdc1911 100644 --- a/lib/ocpp/v16/charge_point_impl.cpp +++ b/lib/ocpp/v16/charge_point_impl.cpp @@ -384,7 +384,6 @@ void ChargePointImpl::try_resume_transactions(const std::set& resum } const auto stop_energy_wh = std::make_shared(timestamp, meter_stop); - transaction->add_stop_energy_wh(stop_energy_wh); transaction->set_transaction_id(transaction_entry.transaction_id); // we need this in order to handle a StartTransaction.conf transaction->set_start_transaction_message_id(transaction_entry.start_transaction_message_id); @@ -409,6 +408,7 @@ void ChargePointImpl::try_resume_transactions(const std::set& resum EVLOG_info << "Queuing StopTransaction.req for transaction with id: " << transaction_entry.transaction_id << " because it hasn't been acknowledged by CSMS and shall not be resumed."; + transaction->add_stop_energy_wh(stop_energy_wh); this->stop_transaction(transaction_entry.connector, Reason::PowerLoss, std::nullopt); } else { EVLOG_info << "Resuming transaction with transaction id: " << transaction_entry.transaction_id;