Put default value in method arguments.
authorJérôme Benoit <jerome.benoit@sap.com>
Mon, 26 Oct 2020 22:23:18 +0000 (23:23 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Mon, 26 Oct 2020 22:23:18 +0000 (23:23 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/charging-station/ChargingStation.js

index da9cfb8778cab064ab297dc8cc4c218f951385a0..505c283d44ae3a822e2a2d024e86427f9983b90a 100644 (file)
@@ -574,7 +574,7 @@ class ChargingStation {
     }
   }
 
-  sendStartTransactionWithTimeout(connectorId, idTag, timeout) {
+  sendStartTransactionWithTimeout(connectorId, idTag, timeout = Constants.START_TRANSACTION_TIMEOUT) {
     setTimeout(() => this.sendStartTransaction(connectorId, idTag), timeout);
   }
 
@@ -1049,7 +1049,7 @@ class ChargingStation {
       // Check if authorized
       if (this._authorizedTags.find((value) => value === commandPayload.idTag)) {
         // Authorization successful start transaction
-        this.sendStartTransactionWithTimeout(transactionConnectorID, commandPayload.idTag, Constants.START_TRANSACTION_TIMEOUT);
+        this.sendStartTransactionWithTimeout(transactionConnectorID, commandPayload.idTag);
         logger.debug(this._logPrefix() + ' Transaction remotely STARTED on ' + this._stationInfo.name + '#' + transactionConnectorID + ' for idTag ' + commandPayload.idTag);
         return Constants.OCPP_RESPONSE_ACCEPTED;
       }
@@ -1057,7 +1057,7 @@ class ChargingStation {
       return Constants.OCPP_RESPONSE_REJECTED;
     }
     // No local authorization check required => start transaction
-    this.sendStartTransactionWithTimeout(transactionConnectorID, commandPayload.idTag, Constants.START_TRANSACTION_TIMEOUT);
+    this.sendStartTransactionWithTimeout(transactionConnectorID, commandPayload.idTag);
     logger.debug(this._logPrefix() + ' Transaction remotely STARTED on ' + this._stationInfo.name + '#' + transactionConnectorID + ' for idTag ' + commandPayload.idTag);
     return Constants.OCPP_RESPONSE_ACCEPTED;
   }