Ensure the ATG will stop on unavaible connector
[e-mobility-charging-stations-simulator.git] / src / charging-station / ChargingStation.ts
index be94daddfe0fadeaf61c6b5778d13e0a947a6d1b..5b5ac56e4d79e8ced4d3e15758f7b554f331550e 100644 (file)
@@ -84,7 +84,7 @@ export default class ChargingStation {
     return this.bootNotificationRequest;
   }
 
-  public getRandomTagId(): string {
+  public getRandomIdTag(): string {
     const index = Math.floor(Utils.secureRandom() * this.authorizedTags.length);
     return this.authorizedTags[index];
   }
@@ -525,7 +525,7 @@ export default class ChargingStation {
       // Generate all connectors
       if ((this.stationInfo.Connectors[0] ? templateMaxConnectors - 1 : templateMaxConnectors) > 0) {
         for (let index = 1; index <= maxConnectors; index++) {
-          const randConnectorId = this.stationInfo.randomConnectors ? Utils.getRandomInt(Utils.convertToInt(lastConnector), 1) : index;
+          const randConnectorId = this.stationInfo.randomConnectors ? Utils.getRandomInteger(Utils.convertToInt(lastConnector), 1) : index;
           this.connectors[index] = Utils.cloneObject<Connector>(this.stationInfo.Connectors[randConnectorId]);
           this.connectors[index].availability = AvailabilityType.OPERATIVE;
           if (Utils.isUndefined(this.connectors[lastConnector]?.chargingProfiles)) {
@@ -1003,7 +1003,7 @@ export default class ChargingStation {
 
   private startStationTemplateFileMonitoring(): void {
     try {
-      fs.watch(this.stationTemplateFile, async (event, filename): Promise<void> => {
+      fs.watch(this.stationTemplateFile, (event, filename): void => {
         if (filename && event === 'change') {
           try {
             logger.debug(this.logPrefix() + ' Template file ' + this.stationTemplateFile + ' have changed, reload');