import { ErrorType } from '../types/ocpp/ErrorType';
import MeasurandValues from '../types/MeasurandValues';
import { MessageType } from '../types/ocpp/MessageType';
+import { OCPPConfigurationKey } from '../types/ocpp/Configuration';
import OCPPError from './OcppError';
import { StandardParametersKey } from '../types/ocpp/1.6/Configuration';
import Statistics from '../utils/Statistics';
}
_getConfigurationKey(key: string | StandardParametersKey, caseInsensitive = false): ConfigurationKey {
- return this._configuration.configurationKey.find((configElement) => {
+ const configurationKey: ConfigurationKey = this._configuration.configurationKey.find((configElement) => {
if (caseInsensitive) {
return configElement.key.toLowerCase() === key.toLowerCase();
}
return configElement.key === key;
});
+ if (configurationKey && Utils.isUndefined(configurationKey.readonly)) {
+ configurationKey.readonly = false;
+ }
+ return configurationKey;
}
_addConfigurationKey(key: string | StandardParametersKey, value: string, readonly = false, visible = true, reboot = false): void {
}
handleRequestGetConfiguration(commandPayload: GetConfigurationRequest): GetConfigurationResponse {
- const configurationKey: ConfigurationKey[] = [];
+ const configurationKey: OCPPConfigurationKey[] = [];
const unknownKey: string[] = [];
if (Utils.isEmptyArray(commandPayload.key)) {
for (const configuration of this._configuration.configurationKey) {
-import { StandardParametersKey } from './ocpp/1.6/Configuration';
+import { OCPPConfigurationKey } from './ocpp/Configuration';
-export interface ConfigurationKey {
- key: string | StandardParametersKey;
- readonly?: boolean;
- value: string;
+export interface ConfigurationKey extends OCPPConfigurationKey{
visible?: boolean;
reboot?: boolean;
}
-import { ConfigurationKey } from '../../ChargingStationConfiguration';
+import { OCPPConfigurationKey } from '../Configuration';
export interface HeartbeatResponse {
currentTime: string;
export interface StatusNotificationResponse { }
export interface GetConfigurationResponse {
- configurationKey: ConfigurationKey[];
+ configurationKey: OCPPConfigurationKey[];
unknownKey: string[];
}