Fix two ATG semantic consistencies
authorJérôme Benoit <jerome.benoit@sap.com>
Wed, 31 Aug 2022 00:29:22 +0000 (02:29 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Wed, 31 Aug 2022 00:29:22 +0000 (02:29 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/charging-station/AutomaticTransactionGenerator.ts

index 6145ac101db56196eed74f77f1df17da840213cb..bf28e55bfdcbc9e4894996f1b383d47a3e0af0b8 100644 (file)
@@ -80,7 +80,7 @@ export default class AutomaticTransactionGenerator {
   }
 
   public startConnector(connectorId: number): void {
-    if (this.connectorsStatus.has(connectorId) === false) {
+    if (this.chargingStation.connectors.has(connectorId) === false) {
       logger.warn(`${this.logPrefix(connectorId)} trying to start on non existing connector`);
       return;
     }
@@ -91,7 +91,7 @@ export default class AutomaticTransactionGenerator {
           /* This is intentional */
         });
       });
-    } else {
+    } else if (this.connectorsStatus.get(connectorId)?.start === true) {
       logger.warn(`${this.logPrefix(connectorId)} already started on connector`);
     }
   }