X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcharging-station%2FChargingStation.js;h=b0a461fadd6f8269af2c902f727dccbecffc40a7;hb=72766a82a1372713a48d9e7143a0348d7fd56a29;hp=91232e5f0c172e404ea7cf09facf01c2a705761c;hpb=facd8ebde74a5d3d16ed65f88d942abcbe79a1e0;p=e-mobility-charging-stations-simulator.git diff --git a/src/charging-station/ChargingStation.js b/src/charging-station/ChargingStation.js index 91232e5f..b0a461fa 100644 --- a/src/charging-station/ChargingStation.js +++ b/src/charging-station/ChargingStation.js @@ -336,7 +336,7 @@ class ChargingStation { sendError(messageId, err) { // Check exception: only OCPP error are accepted - const error = (err instanceof OCPPError ? err : new OCPPError(Constants.OCPP_ERROR_INTERNAL_ERROR, err.message)); + const error = err instanceof OCPPError ? err : new OCPPError(Constants.OCPP_ERROR_INTERNAL_ERROR, err.message); // Send error return this.sendMessage(messageId, error, Constants.OCPP_JSON_CALL_ERROR_MESSAGE); } @@ -514,8 +514,8 @@ class ChargingStation { this.sendStatusNotification(requestPayload.connectorId, 'Charging'); const configuredMeterValueSampleInterval = this._configuration.configurationKey.find((value) => value.key === 'MeterValueSampleInterval'); this.startMeterValues(requestPayload.connectorId, - (configuredMeterValueSampleInterval ? configuredMeterValueSampleInterval.value * 1000 : 60000), - this); + configuredMeterValueSampleInterval ? configuredMeterValueSampleInterval.value * 1000 : 60000, + this); } } } else { @@ -607,7 +607,7 @@ class ChargingStation { } async handleRemoteStartTransaction(commandPayload) { - const transactionConnectorID = (commandPayload.connectorId ? commandPayload.connectorId : '1'); + const transactionConnectorID = commandPayload.connectorId ? commandPayload.connectorId : '1'; if (this.hasAuthorizedTags() && this._getLocalAuthListEnabled() && this._getAuthorizeRemoteTxRequests()) { // Check if authorized if (this._authorizedTags.find((value) => value === commandPayload.idTag)) { @@ -685,7 +685,7 @@ class ChargingStation { sampledValueLcl.sampledValue[index].value = Math.floor(Math.random() * 100) + 1; if (sampledValueLcl.sampledValue[index].value > 100) { logger.info(self._basicFormatLog() + ' MeterValues measurand: ' + - (sampledValueLcl.sampledValue[index].measurand ? sampledValueLcl.sampledValue[index].measurand : 'default') + + sampledValueLcl.sampledValue[index].measurand ? sampledValueLcl.sampledValue[index].measurand : 'Energy.Active.Import.Register' + ', value: ' + sampledValueLcl.sampledValue[index].value); } } else { @@ -703,7 +703,7 @@ class ChargingStation { sampledValueLcl.sampledValue[index].value = connector.lastConsumptionValue; if (sampledValueLcl.sampledValue[index].value > (self._stationInfo.maxPower * 3600 / interval) || sampledValueLcl.sampledValue[index].value < 500) { logger.info(self._basicFormatLog() + ' MeterValues measurand: ' + - (sampledValueLcl.sampledValue[index].measurand ? sampledValueLcl.sampledValue[index].measurand : 'default') + + sampledValueLcl.sampledValue[index].measurand ? sampledValueLcl.sampledValue[index].measurand : 'Energy.Active.Import.Register' + ', value: ' + sampledValueLcl.sampledValue[index].value + '/' + (self._stationInfo.maxPower * 3600 / interval)); } }