refactor: cleanup persistent stationInfo tunable handling
authorJérôme Benoit <jerome.benoit@sap.com>
Thu, 23 Nov 2023 20:46:09 +0000 (21:46 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Thu, 23 Nov 2023 20:46:09 +0000 (21:46 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/charging-station/ChargingStation.ts

index 610c2d547ab960afd00b2421585f14820d513369..02200e4114a101a512374bbbb1432c857c607069 100644 (file)
@@ -1133,7 +1133,7 @@ export class ChargingStation extends EventEmitter {
   }
 
   private getStationInfoFromFile(
-    stationInfoPersistentConfiguration: boolean,
+    stationInfoPersistentConfiguration = true,
   ): ChargingStationInfo | undefined {
     let stationInfo: ChargingStationInfo | undefined;
     if (stationInfoPersistentConfiguration === true) {
@@ -1171,7 +1171,7 @@ export class ChargingStation extends EventEmitter {
     };
     const stationInfoFromTemplate: ChargingStationInfo = this.getStationInfoFromTemplate();
     const stationInfoFromFile: ChargingStationInfo | undefined = this.getStationInfoFromFile(
-      stationInfoFromTemplate?.stationInfoPersistentConfiguration ?? true,
+      stationInfoFromTemplate?.stationInfoPersistentConfiguration,
     );
     // Priority:
     // 1. charging station info from template