fix: Handling of remote start transactions in reserved state
[e-mobility-charging-stations-simulator.git] / src / types / ocpp / 2.0 / Variables.ts
index 3c70898602d6c398032cc51b8d9cb67d6491432d..59b1b023bfbf6b0362590f6393ab435b77e0b0f8 100644 (file)
@@ -1,4 +1,7 @@
-export enum OCPP20ComponentName {
+import type { EVSEType, StatusInfoType } from './Common';
+import type { JsonObject } from '../../JsonType';
+
+enum OCPP20ComponentName {
   AlignedDataCtrlr = 'AlignedDataCtrlr',
   AuthCacheCtrlr = 'AuthCacheCtrlr',
   AuthCtrlr = 'AuthCtrlr',
@@ -58,3 +61,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;