From: Jérôme Benoit Date: Fri, 4 Jun 2021 11:05:50 +0000 (+0200) Subject: Default ATG to send authorize command before starting a transaction X-Git-Tag: v1.0.12~1 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=e644918b4a997877aeae1c7875ef1296585872c7;hp=a3de0c2facc13ff64a02eeae27addda166aed35d;p=e-mobility-charging-stations-simulator.git Default ATG to send authorize command before starting a transaction Signed-off-by: Jérôme Benoit --- diff --git a/README.md b/README.md index cec08120..a525ad66 100644 --- a/README.md +++ b/README.md @@ -110,7 +110,7 @@ Connectors | | | Connectors | charging stations connectors configuration "probabilityOfStart": 1, "stopAfterHours": 0.3, "stopOnConnectionFailure": true, - "requireAuthorize": false + "requireAuthorize": true } ``` #### Connectors section diff --git a/src/assets/station-templates/abb.station-template.json b/src/assets/station-templates/abb.station-template.json index 0ba61ec6..eb30dd4a 100644 --- a/src/assets/station-templates/abb.station-template.json +++ b/src/assets/station-templates/abb.station-template.json @@ -63,7 +63,7 @@ "probabilityOfStart": 1, "stopAfterHours": 0.3, "stopOnConnectionFailure": true, - "requireAuthorize": false + "requireAuthorize": true }, "Connectors": { "0": {}, diff --git a/src/assets/station-templates/evlink.station-template.json b/src/assets/station-templates/evlink.station-template.json index 74436fc3..de6d2983 100644 --- a/src/assets/station-templates/evlink.station-template.json +++ b/src/assets/station-templates/evlink.station-template.json @@ -49,7 +49,7 @@ "probabilityOfStart": 1, "stopAfterHours": 0.3, "stopOnConnectionFailure": false, - "requireAuthorize": false + "requireAuthorize": true }, "Connectors": { "0": {}, diff --git a/src/assets/station-templates/keba.station-template.json b/src/assets/station-templates/keba.station-template.json index 236f0ce5..78e43df9 100644 --- a/src/assets/station-templates/keba.station-template.json +++ b/src/assets/station-templates/keba.station-template.json @@ -46,7 +46,7 @@ "probabilityOfStart": 1, "stopAfterHours": 0.3, "stopOnConnectionFailure": false, - "requireAuthorize": false + "requireAuthorize": true }, "Connectors": { "0": {}, diff --git a/src/assets/station-templates/schneider-imredd.station-template.json b/src/assets/station-templates/schneider-imredd.station-template.json index 6daad3a7..24f6daac 100644 --- a/src/assets/station-templates/schneider-imredd.station-template.json +++ b/src/assets/station-templates/schneider-imredd.station-template.json @@ -48,7 +48,7 @@ "probabilityOfStart": 1, "stopAfterHours": 0.3, "stopOnConnectionFailure": false, - "requireAuthorize": false + "requireAuthorize": true }, "Connectors": { "0": {}, diff --git a/src/assets/station-templates/schneider.station-template.json b/src/assets/station-templates/schneider.station-template.json index 353ad567..605a7fe1 100644 --- a/src/assets/station-templates/schneider.station-template.json +++ b/src/assets/station-templates/schneider.station-template.json @@ -53,7 +53,7 @@ "probabilityOfStart": 1, "stopAfterHours": 0.3, "stopOnConnectionFailure": false, - "requireAuthorize": false + "requireAuthorize": true }, "Connectors": { "0": {}, diff --git a/src/assets/station-templates/siemens.station-template.json b/src/assets/station-templates/siemens.station-template.json index fa05caf0..4d78cca2 100644 --- a/src/assets/station-templates/siemens.station-template.json +++ b/src/assets/station-templates/siemens.station-template.json @@ -47,7 +47,7 @@ "probabilityOfStart": 1, "stopAfterHours": 0.3, "stopOnConnectionFailure": false, - "requireAuthorize": false + "requireAuthorize": true }, "Connectors": { "0": {}, diff --git a/src/assets/station-templates/virtual-simple-atg.station-template.json b/src/assets/station-templates/virtual-simple-atg.station-template.json index a695e2bd..306e03a1 100644 --- a/src/assets/station-templates/virtual-simple-atg.station-template.json +++ b/src/assets/station-templates/virtual-simple-atg.station-template.json @@ -47,7 +47,7 @@ "probabilityOfStart": 1, "stopAfterHours": 0.3, "stopOnConnectionFailure": false, - "requireAuthorize": false + "requireAuthorize": true }, "Connectors": { "0": {}, diff --git a/src/assets/station-templates/virtual-simple.station-template.json b/src/assets/station-templates/virtual-simple.station-template.json index 4af1ab1d..6eb68a46 100644 --- a/src/assets/station-templates/virtual-simple.station-template.json +++ b/src/assets/station-templates/virtual-simple.station-template.json @@ -47,7 +47,7 @@ "probabilityOfStart": 1, "stopAfterHours": 0.3, "stopOnConnectionFailure": false, - "requireAuthorize": false + "requireAuthorize": true }, "Connectors": { "0": {}, diff --git a/src/assets/station-templates/virtual.station-template.json b/src/assets/station-templates/virtual.station-template.json index 0a713610..31d52b59 100644 --- a/src/assets/station-templates/virtual.station-template.json +++ b/src/assets/station-templates/virtual.station-template.json @@ -47,7 +47,7 @@ "probabilityOfStart": 1, "stopAfterHours": 0.3, "stopOnConnectionFailure": false, - "requireAuthorize": false + "requireAuthorize": true }, "Connectors": { "0": {}, diff --git a/src/charging-station/AutomaticTransactionGenerator.ts b/src/charging-station/AutomaticTransactionGenerator.ts index 0562a897..7268f445 100644 --- a/src/charging-station/AutomaticTransactionGenerator.ts +++ b/src/charging-station/AutomaticTransactionGenerator.ts @@ -128,7 +128,7 @@ export default class AutomaticTransactionGenerator { private async startTransaction(connectorId: number, self: AutomaticTransactionGenerator): Promise { if (self.chargingStation.hasAuthorizedTags()) { const tagId = self.chargingStation.getRandomTagId(); - if (self.chargingStation.stationInfo.AutomaticTransactionGenerator.requireAuthorize) { + if (self.chargingStation.getAutomaticTransactionGeneratorRequireAuthorize()) { // Authorize tagId const authorizeResponse = await self.chargingStation.ocppRequestService.sendAuthorize(tagId); if (authorizeResponse?.idTagInfo?.status === AuthorizationStatus.ACCEPTED) { diff --git a/src/charging-station/ChargingStation.ts b/src/charging-station/ChargingStation.ts index 5f8e9677..e9eb86b4 100644 --- a/src/charging-station/ChargingStation.ts +++ b/src/charging-station/ChargingStation.ts @@ -174,6 +174,10 @@ export default class ChargingStation { this.startWebSocketPing(); } + public getAutomaticTransactionGeneratorRequireAuthorize(): boolean { + return this.stationInfo.AutomaticTransactionGenerator.requireAuthorize ?? true; + } + public startHeartbeat(): void { if (this.getHeartbeatInterval() && this.getHeartbeatInterval() > 0 && !this.heartbeatSetInterval) { // eslint-disable-next-line @typescript-eslint/no-misused-promises