From: Jérôme Benoit Date: Sun, 13 Mar 2022 19:31:26 +0000 (+0100) Subject: Ensure configuration key have default settings values X-Git-Tag: v1.1.55~10 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=00db15b822b3f26f67fb36094daf7bd206c96fc2;p=e-mobility-charging-stations-simulator.git Ensure configuration key have default settings values Signed-off-by: Jérôme Benoit --- 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