From: Jérôme Benoit Date: Mon, 14 Mar 2022 19:47:23 +0000 (+0100) Subject: Code cleanups X-Git-Tag: v1.1.55~3 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=7f7b65ca31f598cb9c2a99a6e7b4d31dc6a0acca;p=e-mobility-charging-stations-simulator.git Code cleanups Signed-off-by: Jérôme Benoit --- 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 {