fix: only send UI server response when needed
[e-mobility-charging-stations-simulator.git] / src / charging-station / ChargingStationUtils.ts
index 6fde11e2f0c79aaeda0420673123da2552cc07d3..f86c5d783b82657c483183f9bf43c562e2c11de1 100644 (file)
@@ -145,7 +145,7 @@ export class ChargingStationUtils {
     return connectorBootStatus;
   }
 
-  public static checkTemplateFile(
+  public static checkTemplate(
     stationTemplate: ChargingStationTemplate,
     logPrefix: string,
     templateFile: string
@@ -161,18 +161,10 @@ export class ChargingStationUtils {
       throw new BaseError(errorMsg);
     }
     if (Utils.isEmptyObject(stationTemplate.AutomaticTransactionGenerator)) {
-      stationTemplate.AutomaticTransactionGenerator = {
-        enable: false,
-        minDuration: 60,
-        maxDuration: 120,
-        minDelayBetweenTwoTransactions: 15,
-        maxDelayBetweenTwoTransactions: 30,
-        probabilityOfStart: 1,
-        stopAfterHours: 0.3,
-        stopOnConnectionFailure: true,
-      };
+      stationTemplate.AutomaticTransactionGenerator = Constants.DEFAULT_ATG_CONFIGURATION;
       logger.warn(
-        `${logPrefix} Empty automatic transaction generator configuration from template file ${templateFile}, set to default values`
+        `${logPrefix} Empty automatic transaction generator configuration from template file ${templateFile}, set to default: %j`,
+        Constants.DEFAULT_ATG_CONFIGURATION
       );
     }
     if (