From: Jérôme Benoit Date: Mon, 26 Oct 2020 22:23:18 +0000 (+0100) Subject: Put default value in method arguments. X-Git-Tag: v1.0.1-0~238 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=e5a5f1d2af7ff50d55a3d8b56328bc794d6a2b2d;p=e-mobility-charging-stations-simulator.git Put default value in method arguments. Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/ChargingStation.js b/src/charging-station/ChargingStation.js index da9cfb87..505c283d 100644 --- a/src/charging-station/ChargingStation.js +++ b/src/charging-station/ChargingStation.js @@ -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; }