Skip to content

Commit

Permalink
Review comments.
Browse files Browse the repository at this point in the history
Signed-off-by: Maaike Zijderveld, iolar <[email protected]>
  • Loading branch information
maaikez committed Dec 11, 2024
1 parent 85fb8eb commit 66de0bc
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 12 deletions.
5 changes: 3 additions & 2 deletions interfaces/evse_manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ cmds:
arguments:
reservation_id:
description: >-
The reservation id (should be added to the TransactionStarted event). Negative value if there was
no specific reservation id for this evse (if there are 'global' reservations for 'any' evse).
The reservation id (should be added to the TransactionStarted event). Set this to a negative value if there is
no specific reservation id for this evse but the evse should still move to a Reserved state because of total
global reservations.
type: integer
result:
description: Returns true if the EVSE accepted the reservation, else false.
Expand Down
2 changes: 1 addition & 1 deletion modules/Auth/lib/AuthHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -849,7 +849,7 @@ void AuthHandler::check_evse_reserved_and_send_updates() {
for (const auto& available_evse : reservation_status.available) {
EVLOG_debug << "Evse " << available_evse << " is now available";
this->reservation_cancelled_callback(
available_evse, -1, types::reservation::ReservationEndReason::GlobalReservationConnectorFree, false);
available_evse, -1, types::reservation::ReservationEndReason::GlobalReservationRequirementDropped, false);
}

for (const auto& reserved_evse : reservation_status.reserved) {
Expand Down
2 changes: 0 additions & 2 deletions modules/Auth/lib/ReservationHandler.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include <ReservationHandler.hpp>

#include <algorithm>
#include <iostream>

#include <Connector.hpp>

Expand Down Expand Up @@ -414,7 +413,6 @@ bool ReservationHandler::has_reservation_parent_id(const std::optional<uint32_t>
}

ReservationEvseStatus ReservationHandler::check_number_global_reservations_match_number_available_evses() {
ReservationEvseStatus evse_status;
std::set<int32_t> available_evses;
std::unique_lock<std::recursive_mutex> lock(this->evse_mutex);
// Get all evse's that are not reserved or used.
Expand Down
4 changes: 1 addition & 3 deletions tests/ocpp_tests/test_sets/ocpp16/ocpp_compliance_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -4798,9 +4798,7 @@ async def test_reservation_faulted_state(
call_result.ReserveNowPayload(ReservationStatus.faulted),
)

test_controller.clear_error(1)

await asyncio.sleep(1)
test_controller.clear_error("MREC6UnderVoltage", 1)


@pytest.mark.asyncio
Expand Down
9 changes: 9 additions & 0 deletions tests/ocpp_tests/test_sets/ocpp201/reservations.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,15 @@ async def test_reservation_connector_faulted(
# Set evse in state 'faulted'
test_controller.raise_error("MREC6UnderVoltage", 1)

assert await wait_for_and_validate(
test_utility,
charge_point_v201,
"StatusNotification",
call_201.StatusNotificationPayload(
ANY, 'Faulted', 1, 1
),
)

await asyncio.sleep(1)

t = datetime.utcnow() + timedelta(minutes=10)
Expand Down
8 changes: 4 additions & 4 deletions types/reservation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ types:
Expired: When the reservation expired before the reserved token was used for a session
Cancelled: When the reservation was cancelled manually
UsedToStartCharging: When the reservation ended because the reserved token was used for a session
GlobalReservationConnectorFree: When the reservation ended because there is a connector free and there are less
reservations than available evse's (reservation is still there but it is not
occupying the EVSE anymore).
GlobalReservationRequirementDropped: When the reservation ended for that specific EVSE because there is a
connector free and there are less reservations than available evse's
(reservation is still there but it is not occupying this EVSE anymore).
type: string
enum:
- Expired
- Cancelled
- UsedToStartCharging
- GlobalReservationConnectorFree
- GlobalReservationRequirementDropped
ReservationEnd:
description: Details on Reservation End
type: object
Expand Down

0 comments on commit 66de0bc

Please sign in to comment.