From: Jérôme Benoit Date: Sun, 30 Jul 2023 19:31:13 +0000 (+0200) Subject: fix: fix reservation at remote start X-Git-Tag: v1.2.20~75 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=6677db13413bf11bc6f8c4a509145e3b2453d59a;p=e-mobility-charging-stations-simulator.git fix: fix reservation at remote start Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts b/src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts index f4799d8f..46598b0b 100644 --- a/src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts +++ b/src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts @@ -894,6 +894,12 @@ export class OCPP16IncomingRequestService extends OCPPIncomingRequestService { >(chargingStation, OCPP16RequestCommand.START_TRANSACTION, { connectorId: transactionConnectorId, idTag, + reservationId: chargingStation.getReservationBy( + 'connectorId', + chargingStation.getConnectorStatus(0)!.status === OCPP16ChargePointStatus.Reserved + ? 0 + : transactionConnectorId, + )!, }) ).idTagInfo.status === OCPP16AuthorizationStatus.ACCEPTED ) { @@ -929,6 +935,12 @@ export class OCPP16IncomingRequestService extends OCPPIncomingRequestService { >(chargingStation, OCPP16RequestCommand.START_TRANSACTION, { connectorId: transactionConnectorId, idTag, + reservationId: chargingStation.getReservationBy( + 'connectorId', + chargingStation.getConnectorStatus(0)!.status === OCPP16ChargePointStatus.Reserved + ? 0 + : transactionConnectorId, + )!, }) ).idTagInfo.status === OCPP16AuthorizationStatus.ACCEPTED ) { diff --git a/src/charging-station/ocpp/1.6/OCPP16ResponseService.ts b/src/charging-station/ocpp/1.6/OCPP16ResponseService.ts index 7cafe937..e5caf4bf 100644 --- a/src/charging-station/ocpp/1.6/OCPP16ResponseService.ts +++ b/src/charging-station/ocpp/1.6/OCPP16ResponseService.ts @@ -650,7 +650,6 @@ export class OCPP16ResponseService extends OCPPResponseService { 'connectorId', reservedOnConnectorZero ? 0 : transactionConnectorId, )!; - payload.reservationId = reservation.reservationId; await chargingStation.removeReservation( reservation, ReservationTerminationReason.TRANSACTION_STARTED,