From 6677db13413bf11bc6f8c4a509145e3b2453d59a Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sun, 30 Jul 2023 21:31:13 +0200 Subject: [PATCH] fix: fix reservation at remote start MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- .../ocpp/1.6/OCPP16IncomingRequestService.ts | 12 ++++++++++++ .../ocpp/1.6/OCPP16ResponseService.ts | 1 - 2 files changed, 12 insertions(+), 1 deletion(-) 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, -- 2.34.1