fix: pickup not reserved connector at remote start transaction
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Wed, 5 Jun 2024 15:29:50 +0000 (17:29 +0200)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Wed, 5 Jun 2024 15:29:50 +0000 (17:29 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts

index fc5190469c83b91675c9d5da12eec4f80eb2f7a2..d92d526e4a062884a55021b0e858767ee267e68e 100644 (file)
@@ -1169,7 +1169,13 @@ export class OCPP16IncomingRequestService extends OCPPIncomingRequestService {
       do {
         commandPayload.connectorId = randomInt(1, chargingStation.getNumberOfConnectors())
       } while (
-        chargingStation.getConnectorStatus(commandPayload.connectorId)?.transactionStarted === true
+        chargingStation.getConnectorStatus(commandPayload.connectorId)?.transactionStarted ===
+          true &&
+        OCPP16ServiceUtils.hasReservation(
+          chargingStation,
+          commandPayload.connectorId,
+          commandPayload.idTag
+        )
       )
     }
     const { connectorId: transactionConnectorId, idTag, chargingProfile } = commandPayload