const reboot = options.reboot;
let keyFound = this.getConfigurationKey(key);
if (keyFound && params?.overwrite) {
- this.configuration.configurationKey.splice(
- this.configuration.configurationKey.indexOf(keyFound),
- 1
- );
+ this.deleteConfigurationKey(keyFound.key, { save: false });
keyFound = undefined;
}
if (!keyFound) {
}
}
+ public deleteConfigurationKey(
+ key: string | StandardParametersKey,
+ params: { save?: boolean; caseInsensitive?: boolean } = { save: true, caseInsensitive: false }
+ ): ConfigurationKey[] {
+ const keyFound = this.getConfigurationKey(key, params?.caseInsensitive);
+ if (keyFound) {
+ const deletedConfigurationKey = this.configuration.configurationKey.splice(
+ this.configuration.configurationKey.indexOf(keyFound),
+ 1
+ );
+ params?.save && this.saveConfiguration();
+ return deletedConfigurationKey;
+ }
+ }
+
public setChargingProfile(connectorId: number, cp: ChargingProfile): void {
let cpReplaced = false;
if (!Utils.isEmptyArray(this.getConnectorStatus(connectorId).chargingProfiles)) {
this.getConfiguredSupervisionUrl().href,
{ reboot: true }
);
+ } else if (
+ !this.getSupervisionUrlOcppConfiguration() &&
+ this.getConfigurationKey(this.getSupervisionUrlOcppKey())
+ ) {
+ this.deleteConfigurationKey(this.getSupervisionUrlOcppKey(), { save: false });
}
if (!this.getConfigurationKey(StandardParametersKey.SupportedFeatureProfiles)) {
this.addConfigurationKey(