refactor: move template firmware defaults to constants
[e-mobility-charging-stations-simulator.git] / src / charging-station / ChargingStation.ts
index 29aedcbae2bbb1ee7ee66b23432c27359483cf66..e41ea5ec79980db46558684cca08f2ff9cab6d38 100644 (file)
@@ -1191,15 +1191,6 @@ export class ChargingStation extends EventEmitter {
         } does not match firmware version pattern '${stationInfo.firmwareVersionPattern}'`
       )
     }
-    stationInfo.firmwareUpgrade = mergeDeepRight(
-      {
-        versionUpgrade: {
-          step: 1
-        },
-        reset: true
-      },
-      stationTemplate.firmwareUpgrade ?? {}
-    )
     if (stationTemplate.resetTime != null) {
       stationInfo.resetTime = secondsToMilliseconds(stationTemplate.resetTime)
     }
@@ -1244,7 +1235,7 @@ export class ChargingStation extends EventEmitter {
       stationInfoFromFile.templateHash === stationInfoFromTemplate.templateHash
     ) {
       return setChargingStationOptions(
-        { ...Constants.DEFAULT_STATION_INFO, ...stationInfoFromFile },
+        mergeDeepRight(Constants.DEFAULT_STATION_INFO, stationInfoFromFile),
         options
       )
     }
@@ -1255,7 +1246,7 @@ export class ChargingStation extends EventEmitter {
         stationInfoFromTemplate
       )
     return setChargingStationOptions(
-      { ...Constants.DEFAULT_STATION_INFO, ...stationInfoFromTemplate },
+      mergeDeepRight(Constants.DEFAULT_STATION_INFO, stationInfoFromTemplate),
       options
     )
   }