Default ATG to send authorize command before starting a transaction
authorJérôme Benoit <jerome.benoit@sap.com>
Fri, 4 Jun 2021 11:05:50 +0000 (13:05 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Fri, 4 Jun 2021 11:05:50 +0000 (13:05 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
12 files changed:
README.md
src/assets/station-templates/abb.station-template.json
src/assets/station-templates/evlink.station-template.json
src/assets/station-templates/keba.station-template.json
src/assets/station-templates/schneider-imredd.station-template.json
src/assets/station-templates/schneider.station-template.json
src/assets/station-templates/siemens.station-template.json
src/assets/station-templates/virtual-simple-atg.station-template.json
src/assets/station-templates/virtual-simple.station-template.json
src/assets/station-templates/virtual.station-template.json
src/charging-station/AutomaticTransactionGenerator.ts
src/charging-station/ChargingStation.ts

index cec08120b78d5bee9740173942f69bcc4819a532..a525ad66f15ecb049f17d8b1daa30c9fceb016f7 100644 (file)
--- 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
index 0ba61ec62ed46db772e8aa14c5979f516dcb1bbd..eb30dd4a345b8d35b9088ce1101ef184b32643bd 100644 (file)
@@ -63,7 +63,7 @@
     "probabilityOfStart": 1,
     "stopAfterHours": 0.3,
     "stopOnConnectionFailure": true,
-    "requireAuthorize": false
+    "requireAuthorize": true
   },
   "Connectors": {
     "0": {},
index 74436fc3f4955b67b1f18e29f2d8634f17fe72f8..de6d2983e3f359d9a8e6fdec847434763e0ff5b7 100644 (file)
@@ -49,7 +49,7 @@
     "probabilityOfStart": 1,
     "stopAfterHours": 0.3,
     "stopOnConnectionFailure": false,
-    "requireAuthorize": false
+    "requireAuthorize": true
   },
   "Connectors": {
     "0": {},
index 236f0ce5cc25b5312ce322de626d4454336c7b6b..78e43df9a18af235228c0e30a5e1b723743272bc 100644 (file)
@@ -46,7 +46,7 @@
     "probabilityOfStart": 1,
     "stopAfterHours": 0.3,
     "stopOnConnectionFailure": false,
-    "requireAuthorize": false
+    "requireAuthorize": true
   },
   "Connectors": {
     "0": {},
index 6daad3a7601c5ee77fece24599163caa56bf1a23..24f6daacaf65d3f482684a9e127ee9379b4d7412 100644 (file)
@@ -48,7 +48,7 @@
     "probabilityOfStart": 1,
     "stopAfterHours": 0.3,
     "stopOnConnectionFailure": false,
-    "requireAuthorize": false
+    "requireAuthorize": true
   },
   "Connectors": {
     "0": {},
index 353ad567541409e6428ef01b959eb3f9961f5f83..605a7fe102f66392153260337f6930c143ab101e 100644 (file)
@@ -53,7 +53,7 @@
     "probabilityOfStart": 1,
     "stopAfterHours": 0.3,
     "stopOnConnectionFailure": false,
-    "requireAuthorize": false
+    "requireAuthorize": true
   },
   "Connectors": {
     "0": {},
index fa05caf0d9ca1533fd39df8a29703b824458ea94..4d78cca233dfccf6563f49138d07022a6324367e 100644 (file)
@@ -47,7 +47,7 @@
     "probabilityOfStart": 1,
     "stopAfterHours": 0.3,
     "stopOnConnectionFailure": false,
-    "requireAuthorize": false
+    "requireAuthorize": true
   },
   "Connectors": {
     "0": {},
index a695e2bd999c051fe679a5988226d9fd8acaed76..306e03a14c3f9c054ae1bd67f60aa8ef4803102a 100644 (file)
@@ -47,7 +47,7 @@
     "probabilityOfStart": 1,
     "stopAfterHours": 0.3,
     "stopOnConnectionFailure": false,
-    "requireAuthorize": false
+    "requireAuthorize": true
   },
   "Connectors": {
     "0": {},
index 4af1ab1da97eb4ba46ae0aeb0d8f7aa397a0fec0..6eb68a4611f37463313f2ae2fe602cfe59a36b3f 100644 (file)
@@ -47,7 +47,7 @@
     "probabilityOfStart": 1,
     "stopAfterHours": 0.3,
     "stopOnConnectionFailure": false,
-    "requireAuthorize": false
+    "requireAuthorize": true
   },
   "Connectors": {
     "0": {},
index 0a713610b6ab0e60d9ccadfa018fe55f91c11f28..31d52b59b5e47a3232e036a4346394e79029ef9b 100644 (file)
@@ -47,7 +47,7 @@
     "probabilityOfStart": 1,
     "stopAfterHours": 0.3,
     "stopOnConnectionFailure": false,
-    "requireAuthorize": false
+    "requireAuthorize": true
   },
   "Connectors": {
     "0": {},
index 0562a8973bb8bd36a60f6353e6503339e6111a63..7268f4459c9d7ef5ba6818534a5725445ca8b3af 100644 (file)
@@ -128,7 +128,7 @@ export default class AutomaticTransactionGenerator {
   private async startTransaction(connectorId: number, self: AutomaticTransactionGenerator): Promise<StartTransactionResponse | AuthorizeResponse> {
     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) {
index 5f8e96773a5f270717e6697470ec73b543a32dae..e9eb86b453189382b0b09cf255123de5ebddbf6d 100644 (file)
@@ -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