fix: fix stationInfo persistent configuration default
authorJérôme Benoit <jerome.benoit@sap.com>
Fri, 9 Feb 2024 23:48:23 +0000 (00:48 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Fri, 9 Feb 2024 23:48:23 +0000 (00:48 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/charging-station/ChargingStation.ts

index 3c596bb9a1642bb34a2e627110c9f97a197bcc78..aca295df61a0fae9f3bbef46f720fac49db444d8 100644 (file)
@@ -1221,7 +1221,7 @@ export class ChargingStation extends EventEmitter {
       (stationInfoFromTemplate.stationInfoPersistentConfiguration =
         stationInfoPersistentConfiguration)
     const stationInfoFromFile = this.getStationInfoFromFile(
-      stationInfoFromTemplate.stationInfoPersistentConfiguration
+      stationInfoFromTemplate.stationInfoPersistentConfiguration ?? true
     )
     // Priority:
     // 1. charging station info from template
@@ -1716,10 +1716,7 @@ export class ChargingStation extends EventEmitter {
           configurationData,
           buildChargingStationAutomaticTransactionGeneratorConfiguration(this)
         )
-        if (
-          this.stationInfo?.automaticTransactionGeneratorPersistentConfiguration !== true ||
-          this.getAutomaticTransactionGeneratorConfiguration() == null
-        ) {
+        if (this.stationInfo?.automaticTransactionGeneratorPersistentConfiguration !== true) {
           delete configurationData.automaticTransactionGenerator
         }
         if (this.connectors.size > 0) {