Fix PENDING state boot notification handling
[e-mobility-charging-stations-simulator.git] / src / charging-station / AutomaticTransactionGenerator.ts
index f444018a2e36418254fe927e553d1eab7ce31372..3f5b03c12cebf30c53822b6f6b998d08c810a9a4 100644 (file)
@@ -40,7 +40,7 @@ export default class AutomaticTransactionGenerator {
   }
 
   private startConnectors(): void {
-    if (this.connectorsStatus?.size !== 0 && this.connectorsStatus.size !== this.chargingStation.getNumberOfConnectors()) {
+    if (this.connectorsStatus?.size > 0 && this.connectorsStatus.size !== this.chargingStation.getNumberOfConnectors()) {
       this.connectorsStatus.clear();
     }
     for (const connectorId of this.chargingStation.connectors.keys()) {
@@ -66,8 +66,8 @@ export default class AutomaticTransactionGenerator {
         this.stopConnector(connectorId);
         break;
       }
-      if (!this.chargingStation.isRegistered()) {
-        logger.error(this.logPrefix(connectorId) + ' entered in transaction loop while the charging station is not registered');
+      if (!this.chargingStation.isInAcceptedState()) {
+        logger.error(this.logPrefix(connectorId) + ' entered in transaction loop while the charging station is in accepted state');
         this.stopConnector(connectorId);
         break;
       }