From 7492962b63595fb98f8d711db3e7a567fa8d9fa1 Mon Sep 17 00:00:00 2001 From: Lucas Vieira Date: Fri, 20 Sep 2024 17:35:34 +0200 Subject: [PATCH] FIX: add security profile --- src/lib/settings.ts | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/src/lib/settings.ts b/src/lib/settings.ts index 33c9b7c..d5e10d0 100644 --- a/src/lib/settings.ts +++ b/src/lib/settings.ts @@ -276,6 +276,11 @@ export const defaultVariableConfig16: Variable16[] = [ description: 'Supported file transfer protocols', value: 'HTTP,FTP,HTTPS,FTPS', }, + { + key: 'SecurityProfile', + description: 'Security profile used for communication', + value: '0', + }, ]; export interface Variable201 { @@ -687,6 +692,25 @@ export const defaultVariableConfig201: Variable201[] = [ supportsMonitoring: false, }, }, + { + component: { + name: 'SecurityCtrlr', + }, + variable: { + name: 'SecurityProfile', + }, + variableAttribute: [ + { + value: '0', + persistent: true, + constant: false, + }, + ], + variableCharacteristics: { + dataType: 'integer', + supportsMonitoring: false, + }, + }, ]; export function getDocumentQuery() { @@ -983,9 +1007,11 @@ class VariableConfiguration16 implements VariableConfiguration { updateVariablesFromKeyValueMap(variables: VariableKeyValueMap) { for (const variable of Object.values(variables)) { if (!this.variables[variable.key]) { - throw new Error( - `Variable ${variable.key} not found in configuration when updating variables` - ); + // In case a new configuration was added to the charging station (eg: ChangeConfiguration) + this.variables[variable.key] = { + key: variable.key, + value: variable.value, + }; } this.variables[variable.key].value = variable.value;