X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Ftypes%2Focpp%2F2.0%2FVariables.ts;h=0b089567c6719680ea690d1b411eddfbf9318bf7;hb=e8044a69a745aab08dfeea0bd9ec9dd7fe84cdd7;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..0b089567 100644 --- a/src/types/ocpp/2.0/Variables.ts +++ b/src/types/ocpp/2.0/Variables.ts @@ -1,4 +1,6 @@ -export enum OCPP20ComponentName { +import type { EVSEType, JsonObject, StatusInfoType } from '../../internal'; + +enum OCPP20ComponentName { AlignedDataCtrlr = 'AlignedDataCtrlr', AuthCacheCtrlr = 'AuthCacheCtrlr', AuthCtrlr = 'AuthCtrlr', @@ -58,3 +60,56 @@ export enum OCPP20OptionalVariableName { export enum OCPP20VendorVariableName { ConnectionUrl = 'ConnectionUrl', } + +enum AttributeEnumType { + Actual = 'Actual', + Target = 'Target', + MinSet = 'MinSet', + MaxSet = 'MaxSet', +} + +type ComponentType = { + name: string | OCPP20ComponentName; + instance?: string; + evse?: EVSEType; +} & JsonObject; + +type VariableName = + | string + | OCPP20RequiredVariableName + | OCPP20OptionalVariableName + | OCPP20VendorVariableName; + +type VariableType = { + name: VariableName; + instance?: string; +} & JsonObject; + +export type OCPP20SetVariableDataType = { + attributeType?: AttributeEnumType; + attributeValue: string; + component: ComponentType; + variable: VariableType; +} & JsonObject; + +enum SetVariableStatusEnumType { + Accepted = 'Accepted', + Rejected = 'Rejected', + UnknownComponent = 'UnknownComponent', + UnknownVariable = 'UnknownVariable', + NotSupportedAttributeType = 'NotSupportedAttributeType', + RebootRequired = 'RebootRequired', +} + +export type OCPP20SetVariableResultType = { + attributeType?: AttributeEnumType; + attributeStatus: SetVariableStatusEnumType; + component: ComponentType; + variable: VariableType; + attributeStatusInfo?: StatusInfoType; +} & JsonObject; + +type OCPP20ComponentVariableType = { + component: ComponentType; + variable?: VariableType; +} & JsonObject;