refactor: applied changes for pull request
[e-mobility-charging-stations-simulator.git] / src / types / ChargingStationTemplate.ts
CommitLineData
dada83ec 1import type { ClientRequestArgs } from 'node:http';
8114d10e 2
6c1761d4 3import type { ClientOptions } from 'ws';
8114d10e 4
69074173
JB
5import type { AutomaticTransactionGeneratorConfiguration } from './AutomaticTransactionGenerator';
6import type { ChargingStationOcppConfiguration } from './ChargingStationOcppConfiguration';
7import type { ConnectorStatus } from './ConnectorStatus';
8import type { EvseTemplate } from './Evse';
9import type { OCPPProtocol } from './ocpp/OCPPProtocol';
10import type { OCPPVersion } from './ocpp/OCPPVersion';
d4c84337
JB
11import type {
12 FirmwareStatus,
13 IncomingRequestCommand,
14 MessageTrigger,
15 RequestCommand,
69074173 16} from './ocpp/Requests';
9ac86a7e 17
4c2b4904 18export enum CurrentType {
9ac86a7e
JB
19 AC = 'AC',
20 DC = 'DC',
21}
22
a02da55f 23export enum PowerUnits {
9ac86a7e
JB
24 WATT = 'W',
25 KILO_WATT = 'kW',
26}
27
cc6e8ab5
JB
28export enum AmpereUnits {
29 MILLI_AMPERE = 'mA',
30 CENTI_AMPERE = 'cA',
31 DECI_AMPERE = 'dA',
32 AMPERE = 'A',
33}
34
4c2b4904 35export enum Voltage {
84d4e562
JB
36 VOLTAGE_110 = 110,
37 VOLTAGE_230 = 230,
fd0c36fa 38 VOLTAGE_400 = 400,
e7aeea18 39 VOLTAGE_800 = 800,
84d4e562
JB
40}
41
2484ac1e
JB
42export type WsOptions = ClientOptions & ClientRequestArgs;
43
5d280aae 44export type FirmwareUpgrade = {
15748260 45 versionUpgrade?: {
5d280aae 46 patternGroup?: number;
d4c84337 47 step?: number;
b25b8684
JB
48 };
49 reset?: boolean;
5d280aae 50 failureStatus?: FirmwareStatus;
b25b8684
JB
51};
52
83e00df1 53type CommandsSupport = {
65554cc3
JB
54 incomingCommands: Record<IncomingRequestCommand, boolean>;
55 outgoingCommands?: Record<RequestCommand, boolean>;
83e00df1 56};
65554cc3 57
981ebfbe 58export type ChargingStationTemplate = {
f765beaa 59 templateHash?: string;
2dcfe98e 60 supervisionUrls?: string | string[];
1f5df42a
JB
61 supervisionUrlOcppConfiguration?: boolean;
62 supervisionUrlOcppKey?: string;
15042c5f
JB
63 supervisionUser?: string;
64 supervisionPassword?: string;
c0560973
JB
65 ocppVersion?: OCPPVersion;
66 ocppProtocol?: OCPPProtocol;
672fed6e 67 ocppStrictCompliance?: boolean;
e8e865ea 68 ocppPersistentConfiguration?: boolean;
ccb1d6e9 69 stationInfoPersistentConfiguration?: boolean;
2484ac1e 70 wsOptions?: WsOptions;
e302df1d 71 idTagsFile?: string;
9ac86a7e 72 baseName: string;
5fdab605 73 nameSuffix?: string;
a02da55f 74 fixedName?: boolean;
9ac86a7e
JB
75 chargePointModel: string;
76 chargePointVendor: string;
43bb4cd9 77 chargePointSerialNumberPrefix?: string;
9ac86a7e 78 chargeBoxSerialNumberPrefix?: string;
b25b8684 79 firmwareVersionPattern?: string;
9ac86a7e 80 firmwareVersion?: string;
b25b8684 81 firmwareUpgrade?: FirmwareUpgrade;
3f94cab5
JB
82 iccid?: string;
83 imsi?: string;
0b7c34ba 84 meterSerialNumberPrefix?: string;
3f94cab5 85 meterType?: string;
9ac86a7e
JB
86 power: number | number[];
87 powerSharedByConnectors?: boolean;
ef16e252 88 powerUnit: PowerUnits;
4c2b4904
JB
89 currentOutType?: CurrentType;
90 voltageOut?: Voltage;
9ac86a7e
JB
91 numberOfPhases?: number;
92 numberOfConnectors?: number | number[];
93 useConnectorId0?: boolean;
94 randomConnectors?: boolean;
95 resetTime?: number;
7c72977b 96 autoRegister?: boolean;
3574dfd3 97 autoReconnectMaxRetries?: number;
032d6efc 98 reconnectExponentialDelay?: boolean;
6ad94506 99 registrationMaxRetries?: number;
9ac86a7e 100 enableStatistics?: boolean;
03ebf4c1 101 mustAuthorizeAtRemoteStart?: boolean;
e3018bc4 102 payloadSchemaValidation?: boolean;
cc6e8ab5
JB
103 amperageLimitationOcppKey?: string;
104 amperageLimitationUnit?: AmpereUnits;
6ed92bc1
JB
105 beginEndMeterValues?: boolean;
106 outOfOrderEndMeterValues?: boolean;
107 meteringPerTransaction?: boolean;
fd0c36fa 108 transactionDataMeterValues?: boolean;
9ccca265 109 mainVoltageMeterValues?: boolean;
6b10669b 110 phaseLineToLineVoltageMeterValues?: boolean;
7bc31f9c 111 customValueLimitationMeterValues?: boolean;
65554cc3 112 commandsSupport?: CommandsSupport;
c60ed4b8 113 messageTriggerSupport?: Record<MessageTrigger, boolean>;
2484ac1e 114 Configuration?: ChargingStationOcppConfiguration;
fa7bccf4 115 AutomaticTransactionGenerator?: AutomaticTransactionGeneratorConfiguration;
a78ef5ed 116 Evses?: Record<string, EvseTemplate>;
8a133cc8 117 Connectors?: Record<string, ConnectorStatus>;
981ebfbe 118};