Skip to content

Commit

Permalink
v1.6: Persist queued changeAvailabilty (EVerest#629)
Browse files Browse the repository at this point in the history
* Persist queued changeAvailabilty
---------

Signed-off-by: Matthias Suess <[email protected]>
Signed-off-by: Piet Gömpel <[email protected]>
Co-authored-by: Matthias Suess <[email protected]>
Co-authored-by: Piet Gömpel <[email protected]>
  • Loading branch information
3 people authored and christopher-davis-afs committed May 30, 2024
1 parent 8e0a667 commit e7d07b6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/ocpp/v16/charge_point_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1350,6 +1350,11 @@ void ChargePointImpl::preprocess_change_availability_request(
}
}

// We store the queued request in the database, so in case of a powerloss the operational state is persisted.
for (const auto& [connector, availabilityChange] : this->change_availability_queue) {
this->database_handler->insert_or_update_connector_availability(connector, availabilityChange.availability);
}

if (transaction_running) {
response.status = AvailabilityStatus::Scheduled;
} else {
Expand Down

0 comments on commit e7d07b6

Please sign in to comment.