refactor: move template firmware defaults to constants
authorJérôme Benoit <jerome.benoit@sap.com>
Tue, 19 Mar 2024 19:15:06 +0000 (20:15 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Tue, 19 Mar 2024 19:15:06 +0000 (20:15 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/charging-station/ChargingStation.ts
src/utils/Constants.ts

index 92b5fe753a34efceb03334364a0a67b2aa44e91c..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)
     }
index a5e46f60673e3078afd9386c4b3995c0800477b5..3746c4fdd91e8277ebc5167c563cbd3cf88fb673 100644 (file)
@@ -34,6 +34,12 @@ export class Constants {
     useConnectorId0: true,
     ocppVersion: OCPPVersion.VERSION_16,
     firmwareVersionPattern: Constants.SEMVER_PATTERN,
+    firmwareUpgrade: {
+      versionUpgrade: {
+        step: 1
+      },
+      reset: true
+    },
     ocppPersistentConfiguration: true,
     stationInfoPersistentConfiguration: true,
     automaticTransactionGeneratorPersistentConfiguration: true,