fix: fix reservation at remote start
authorJérôme Benoit <jerome.benoit@sap.com>
Sun, 30 Jul 2023 19:31:13 +0000 (21:31 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Sun, 30 Jul 2023 19:31:13 +0000 (21:31 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts
src/charging-station/ocpp/1.6/OCPP16ResponseService.ts

index f4799d8fce31db9c14408e78bedd37a6ec1acdcf..46598b0b6e5aa7161827eec3f336b35981f9f0ba 100644 (file)
@@ -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
       ) {
index 7cafe937dc7623e48e6ddfa27907722fb2ab5dc7..e5caf4bf3cfb9d23c41e1403125a23d784943fe2 100644 (file)
@@ -650,7 +650,6 @@ export class OCPP16ResponseService extends OCPPResponseService {
           'connectorId',
           reservedOnConnectorZero ? 0 : transactionConnectorId,
         )!;
-        payload.reservationId = reservation.reservationId;
         await chargingStation.removeReservation(
           reservation,
           ReservationTerminationReason.TRANSACTION_STARTED,