},
params: { overwrite?: boolean; save?: boolean } = { overwrite: false, save: false }
): void {
- if (!options || Utils.isEmptyObject(options)) {
- options = {
- readonly: false,
- visible: true,
- reboot: false,
- };
- }
- const readonly = options.readonly ?? false;
- const visible = options.visible ?? true;
- const reboot = options.reboot ?? false;
+ options = options ?? ({} as { readonly?: boolean; visible?: boolean; reboot?: boolean });
+ options.readonly = options?.readonly ?? false;
+ options.visible = options?.visible ?? true;
+ options.reboot = options?.reboot ?? false;
let keyFound = this.getConfigurationKey(key);
if (keyFound && params?.overwrite) {
this.deleteConfigurationKey(keyFound.key, { save: false });
if (!keyFound) {
this.configuration.configurationKey.push({
key,
- readonly,
+ readonly: options.readonly,
value,
- visible,
- reboot,
+ visible: options.visible,
+ reboot: options.reboot,
});
params?.save && this.saveConfiguration();
} else {
);
this.convertDeprecatedTemplateKey(stationTemplateFromFile, 'supervisionUrl', 'supervisionUrls');
const stationInfo: ChargingStationInfo = stationTemplateFromFile ?? ({} as ChargingStationInfo);
- stationInfo.chargePointSerialNumber = stationTemplateFromFile?.chargePointSerialNumberPrefix;
+ stationInfo.chargePointSerialNumber =
+ stationTemplateFromFile?.chargePointSerialNumberPrefix &&
+ stationTemplateFromFile.chargePointSerialNumberPrefix;
delete stationInfo.chargePointSerialNumberPrefix;
- stationInfo.chargeBoxSerialNumber = stationTemplateFromFile?.chargeBoxSerialNumberPrefix;
+ stationInfo.chargeBoxSerialNumber =
+ stationTemplateFromFile?.chargeBoxSerialNumberPrefix &&
+ stationTemplateFromFile.chargeBoxSerialNumberPrefix;
delete stationInfo.chargeBoxSerialNumberPrefix;
stationInfo.wsOptions = stationTemplateFromFile?.wsOptions ?? {};
if (!Utils.isEmptyArray(stationTemplateFromFile.power)) {
meterType: this.stationInfo.meterType,
}),
};
-
this.hashId = crypto
.createHash(Constants.DEFAULT_HASH_ALGORITHM)
.update(JSON.stringify(this.bootNotificationRequest) + this.stationInfo.chargingStationId)