From 00db15b822b3f26f67fb36094daf7bd206c96fc2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sun, 13 Mar 2022 20:31:26 +0100 Subject: [PATCH] Ensure configuration key have default settings values 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 | 6 +++--- src/charging-station/ocpp/1.6/OCPP16ResponseService.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/charging-station/ChargingStation.ts b/src/charging-station/ChargingStation.ts index 09cfa74f..90b788a6 100644 --- a/src/charging-station/ChargingStation.ts +++ b/src/charging-station/ChargingStation.ts @@ -632,9 +632,9 @@ export default class ChargingStation { reboot: false, }; } - const readonly = options.readonly; - const visible = options.visible; - const reboot = options.reboot; + const readonly = options.readonly ?? false; + const visible = options.visible ?? true; + const reboot = options.reboot ?? false; let keyFound = this.getConfigurationKey(key); if (keyFound && params?.overwrite) { this.deleteConfigurationKey(keyFound.key, { save: false }); diff --git a/src/charging-station/ocpp/1.6/OCPP16ResponseService.ts b/src/charging-station/ocpp/1.6/OCPP16ResponseService.ts index 92fee660..08197142 100644 --- a/src/charging-station/ocpp/1.6/OCPP16ResponseService.ts +++ b/src/charging-station/ocpp/1.6/OCPP16ResponseService.ts @@ -111,7 +111,7 @@ export default class OCPP16ResponseService extends OCPPResponseService { this.chargingStation.addConfigurationKey( OCPP16StandardParametersKey.HeartbeatInterval, payload.interval.toString(), - { visible: false, reboot: false }, + { visible: false }, { overwrite: true, save: true } ); this.chargingStation.heartbeatSetInterval -- 2.34.1