Add debug log for CPs.
[e-mobility-charging-stations-simulator.git] / src / charging-station / AutomaticTransactionGenerator.ts
index 3f821c8ee822df0620718c42cec23fa78228bf80..90dff98bd09dfc9b69ade8466ed04d4158670426 100644 (file)
@@ -23,17 +23,18 @@ export default class AutomaticTransactionGenerator {
     }
   }
 
-  public start(): void {
+  public async start(): Promise<void> {
     this.timeToStop = false;
     if (this.chargingStation.stationInfo.AutomaticTransactionGenerator.stopAfterHours &&
       this.chargingStation.stationInfo.AutomaticTransactionGenerator.stopAfterHours > 0) {
-      setTimeout(() => {
-        void this.stop();
+      // eslint-disable-next-line @typescript-eslint/no-misused-promises
+      setTimeout(async (): Promise<void> => {
+        await this.stop();
       }, this.chargingStation.stationInfo.AutomaticTransactionGenerator.stopAfterHours * 3600 * 1000);
     }
     for (const connector in this.chargingStation.connectors) {
       if (Utils.convertToInt(connector) > 0) {
-        void this.startConnector(Utils.convertToInt(connector));
+        await this.startConnector(Utils.convertToInt(connector));
       }
     }
     logger.info(this.logPrefix() + ' ATG started and will stop in ' + Utils.secondsToHHMMSS(this.chargingStation.stationInfo.AutomaticTransactionGenerator.stopAfterHours * 3600));