fix(ui): remove WS event listeners at main page unmount
[e-mobility-charging-stations-simulator.git] / src / types / ChargingStationTemplate.ts
CommitLineData
66a7748d 1import type { ClientRequestArgs } from 'node:http'
8114d10e 2
66a7748d 3import type { ClientOptions } from 'ws'
8114d10e 4
66a7748d
JB
5import type { AutomaticTransactionGeneratorConfiguration } from './AutomaticTransactionGenerator.js'
6import type { ChargingStationOcppConfiguration } from './ChargingStationOcppConfiguration.js'
7import type { ConnectorStatus } from './ConnectorStatus.js'
8import type { EvseTemplate } from './Evse.js'
9import type { OCPPProtocol } from './ocpp/OCPPProtocol.js'
10import type { OCPPVersion } from './ocpp/OCPPVersion.js'
d4c84337
JB
11import type {
12 FirmwareStatus,
13 IncomingRequestCommand,
14 MessageTrigger,
66a7748d
JB
15 RequestCommand
16} from './ocpp/Requests.js'
9ac86a7e 17
4c2b4904 18export enum CurrentType {
9ac86a7e 19 AC = 'AC',
a223d9be 20 DC = 'DC'
9ac86a7e
JB
21}
22
a02da55f 23export enum PowerUnits {
9ac86a7e 24 WATT = 'W',
a223d9be 25 KILO_WATT = 'kW'
9ac86a7e
JB
26}
27
cc6e8ab5
JB
28export enum AmpereUnits {
29 MILLI_AMPERE = 'mA',
30 CENTI_AMPERE = 'cA',
31 DECI_AMPERE = 'dA',
a223d9be 32 AMPERE = 'A'
cc6e8ab5
JB
33}
34
4c2b4904 35export enum Voltage {
84d4e562
JB
36 VOLTAGE_110 = 110,
37 VOLTAGE_230 = 230,
fd0c36fa 38 VOLTAGE_400 = 400,
a223d9be 39 VOLTAGE_800 = 800
84d4e562
JB
40}
41
66a7748d 42export type WsOptions = ClientOptions & ClientRequestArgs
2484ac1e 43
e1d9a0f4 44export interface FirmwareUpgrade {
15748260 45 versionUpgrade?: {
66a7748d
JB
46 patternGroup?: number
47 step?: number
48 }
49 reset?: boolean
50 failureStatus?: FirmwareStatus
e1d9a0f4 51}
b25b8684 52
e1d9a0f4 53interface CommandsSupport {
66a7748d
JB
54 incomingCommands: Record<IncomingRequestCommand, boolean>
55 outgoingCommands?: Record<RequestCommand, boolean>
e1d9a0f4 56}
65554cc3 57
d4d65733
JB
58enum x509CertificateType {
59 V2GRootCertificate = 'V2GRootCertificate',
60 MORootCertificate = 'MORootCertificate',
61 CSMSRootCertificate = 'CSMSRootCertificate',
62 ManufacturerRootCertificate = 'ManufacturerRootCertificate',
63 ChargingStationCertificate = 'ChargingStationCertificate',
a223d9be 64 V2GCertificate = 'V2GCertificate'
d4d65733
JB
65}
66
e1d9a0f4 67export interface ChargingStationTemplate {
66a7748d
JB
68 templateHash?: string
69 supervisionUrls?: string | string[]
70 supervisionUrlOcppConfiguration?: boolean
71 supervisionUrlOcppKey?: string
72 supervisionUser?: string
73 supervisionPassword?: string
244c1396 74 autoStart?: boolean
66a7748d
JB
75 ocppVersion?: OCPPVersion
76 ocppProtocol?: OCPPProtocol
77 ocppStrictCompliance?: boolean
78 ocppPersistentConfiguration?: boolean
79 stationInfoPersistentConfiguration?: boolean
80 automaticTransactionGeneratorPersistentConfiguration?: boolean
81 wsOptions?: WsOptions
82 idTagsFile?: string
83 baseName: string
84 nameSuffix?: string
85 fixedName?: boolean
86 chargePointModel: string
87 chargePointVendor: string
88 chargePointSerialNumberPrefix?: string
89 chargeBoxSerialNumberPrefix?: string
90 firmwareVersionPattern?: string
91 firmwareVersion?: string
92 firmwareUpgrade?: FirmwareUpgrade
93 iccid?: string
94 imsi?: string
95 meterSerialNumberPrefix?: string
96 meterType?: string
97 power?: number | number[]
98 powerUnit?: PowerUnits
99 powerSharedByConnectors?: boolean
100 currentOutType?: CurrentType
101 voltageOut?: Voltage
102 numberOfPhases?: number
103 numberOfConnectors?: number | number[]
104 useConnectorId0?: boolean
105 randomConnectors?: boolean
106 resetTime?: number
107 autoRegister?: boolean
108 autoReconnectMaxRetries?: number
109 reconnectExponentialDelay?: boolean
110 registrationMaxRetries?: number
111 enableStatistics?: boolean
112 remoteAuthorization?: boolean
cfdf901d 113 /** @deprecated Replaced by remoteAuthorization */
66a7748d 114 mustAuthorizeAtRemoteStart?: boolean
0282b7c0 115 /** @deprecated Replaced by ocppStrictCompliance */
66a7748d
JB
116 payloadSchemaValidation?: boolean
117 amperageLimitationOcppKey?: string
118 amperageLimitationUnit?: AmpereUnits
119 beginEndMeterValues?: boolean
120 outOfOrderEndMeterValues?: boolean
121 meteringPerTransaction?: boolean
122 transactionDataMeterValues?: boolean
123 stopTransactionsOnStopped?: boolean
124 mainVoltageMeterValues?: boolean
125 phaseLineToLineVoltageMeterValues?: boolean
126 customValueLimitationMeterValues?: boolean
127 commandsSupport?: CommandsSupport
128 messageTriggerSupport?: Record<MessageTrigger, boolean>
129 Configuration?: ChargingStationOcppConfiguration
130 AutomaticTransactionGenerator?: AutomaticTransactionGeneratorConfiguration
131 Evses?: Record<string, EvseTemplate>
132 Connectors?: Record<string, ConnectorStatus>
133 x509Certificates?: Record<x509CertificateType, string>
e1d9a0f4 134}