From 7f7b65ca31f598cb9c2a99a6e7b4d31dc6a0acca Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Mon, 14 Mar 2022 20:47:23 +0100 Subject: [PATCH] Code cleanups MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/charging-station/ChargingStation.ts | 2 +- .../ocpp/1.6/OCPP16IncomingRequestService.ts | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/charging-station/ChargingStation.ts b/src/charging-station/ChargingStation.ts index 48c56e4d..ba6fd61f 100644 --- a/src/charging-station/ChargingStation.ts +++ b/src/charging-station/ChargingStation.ts @@ -1129,7 +1129,7 @@ export default class ChargingStation { this.saveOcppConfiguration(); } - private getConfigurationFromFile(): ChargingStationConfiguration { + private getConfigurationFromFile(): ChargingStationConfiguration | null { let configuration: ChargingStationConfiguration = null; if (this.configurationFile && fs.existsSync(this.configurationFile)) { try { diff --git a/src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts b/src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts index b4fb12cf..b67090af 100644 --- a/src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts +++ b/src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts @@ -265,17 +265,17 @@ export default class OCPP16IncomingRequestService extends OCPPIncomingRequestSer const configurationKey: OCPPConfigurationKey[] = []; const unknownKey: string[] = []; if (Utils.isEmptyArray(commandPayload.key)) { - for (const key of this.chargingStation.ocppConfiguration.configurationKey) { - if (Utils.isUndefined(key.visible)) { - key.visible = true; + for (const configuration of this.chargingStation.ocppConfiguration.configurationKey) { + if (Utils.isUndefined(configuration.visible)) { + configuration.visible = true; } - if (!key.visible) { + if (!configuration.visible) { continue; } configurationKey.push({ - key: key.key, - readonly: key.readonly, - value: key.value, + key: configuration.key, + readonly: configuration.readonly, + value: configuration.value, }); } } else { -- 2.34.1