X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Ftypes%2Focpp%2F2.0%2FVariables.ts;h=04a344564bcd202e3a6ab5dcef35798545b09620;hb=16c46962f43a692c996b1c89a94dc572fea52d63;hp=3c70898602d6c398032cc51b8d9cb67d6491432d;hpb=857d8dd995425597a2bfb15d49e7ee6d69b055bd;p=e-mobility-charging-stations-simulator.git diff --git a/src/types/ocpp/2.0/Variables.ts b/src/types/ocpp/2.0/Variables.ts index 3c708986..04a34456 100644 --- a/src/types/ocpp/2.0/Variables.ts +++ b/src/types/ocpp/2.0/Variables.ts @@ -1,4 +1,7 @@ -export enum OCPP20ComponentName { +import type { JsonObject } from '../../JsonType.js' +import type { EVSEType, StatusInfoType } from './Common.js' + +enum OCPP20ComponentName { AlignedDataCtrlr = 'AlignedDataCtrlr', AuthCacheCtrlr = 'AuthCacheCtrlr', AuthCtrlr = 'AuthCtrlr', @@ -16,7 +19,7 @@ export enum OCPP20ComponentName { SecurityCtrlr = 'SecurityCtrlr', SmartChargingCtrlr = 'SmartChargingCtrlr', TariffCostCtrlr = 'TariffCostCtrlr', - TxCtrlr = 'TxCtrlr', + TxCtrlr = 'TxCtrlr' } export enum OCPP20RequiredVariableName { @@ -47,14 +50,67 @@ export enum OCPP20RequiredVariableName { TxEndedMeasurands = 'TxEndedMeasurands', TxStartedMeasurands = 'TxStartedMeasurands', TxUpdatedMeasurands = 'TxUpdatedMeasurands', - TxUpdatedInterval = 'TxUpdatedInterval', + TxUpdatedInterval = 'TxUpdatedInterval' } export enum OCPP20OptionalVariableName { HeartbeatInterval = 'HeartbeatInterval', - WebSocketPingInterval = 'WebSocketPingInterval', + WebSocketPingInterval = 'WebSocketPingInterval' } export enum OCPP20VendorVariableName { - ConnectionUrl = 'ConnectionUrl', + ConnectionUrl = 'ConnectionUrl' +} + +enum AttributeEnumType { + Actual = 'Actual', + Target = 'Target', + MinSet = 'MinSet', + MaxSet = 'MaxSet' +} + +interface ComponentType extends JsonObject { + name: string | OCPP20ComponentName + instance?: string + evse?: EVSEType +} + +type VariableName = + | string + | OCPP20RequiredVariableName + | OCPP20OptionalVariableName + | OCPP20VendorVariableName + +interface VariableType extends JsonObject { + name: VariableName + instance?: string +} + +export interface OCPP20SetVariableDataType extends JsonObject { + attributeType?: AttributeEnumType + attributeValue: string + component: ComponentType + variable: VariableType +} + +enum SetVariableStatusEnumType { + Accepted = 'Accepted', + Rejected = 'Rejected', + UnknownComponent = 'UnknownComponent', + UnknownVariable = 'UnknownVariable', + NotSupportedAttributeType = 'NotSupportedAttributeType', + RebootRequired = 'RebootRequired' +} + +export interface OCPP20SetVariableResultType extends JsonObject { + attributeType?: AttributeEnumType + attributeStatus: SetVariableStatusEnumType + component: ComponentType + variable: VariableType + attributeStatusInfo?: StatusInfoType +} + +export interface OCPP20ComponentVariableType extends JsonObject { + component: ComponentType + variable?: VariableType }