Merge dependabot/npm_and_yarn/ui/web/jsdom-23.1.0 into combined-prs-branch
[e-mobility-charging-stations-simulator.git] / src / types / ocpp / 2.0 / Variables.ts
index 3c70898602d6c398032cc51b8d9cb67d6491432d..2aa2ed3332b7486f853da09033f8dbfca4f19c71 100644 (file)
@@ -1,4 +1,7 @@
-export enum OCPP20ComponentName {
+import type { EVSEType, StatusInfoType } from './Common.js'
+import type { JsonObject } from '../../JsonType.js'
+
+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
+
+export type OCPP20ComponentVariableType = {
+  component: ComponentType
+  variable?: VariableType
+} & JsonObject