Fix remote start transactiion: connection status can be preparing
authorJérôme Benoit <jerome.benoit@sap.com>
Tue, 31 Aug 2021 15:25:12 +0000 (17:25 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Tue, 31 Aug 2021 15:25:12 +0000 (17:25 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/charging-station/ocpp/1.6/OCPP16ResponseService.ts

index fa015906606370fd8f2bff724fe8b906e0f93012..985870d210d1a0974fb63bd2dea64f559aced44d 100644 (file)
@@ -56,7 +56,8 @@ export default class OCPP16ResponseService extends OCPPResponseService {
       logger.debug(this.chargingStation.logPrefix() + ' Trying to start a transaction on an already used connector ' + connectorId.toString() + ': %j', this.chargingStation.getConnector(connectorId));
       return;
     }
-    if (this.chargingStation.getConnector(connectorId)?.status !== OCPP16ChargePointStatus.AVAILABLE) {
+    if (this.chargingStation.getConnector(connectorId)?.status !== OCPP16ChargePointStatus.AVAILABLE
+        || this.chargingStation.getConnector(connectorId)?.status !== OCPP16ChargePointStatus.PREPARING) {
       logger.error(`${this.chargingStation.logPrefix()} Trying to start a transaction on connector ${connectorId.toString()} with status ${this.chargingStation.getConnector(connectorId)?.status}`);
       return;
     }