fix(simulator): fix default version bump scale at firmware upgrade
authorJérôme Benoit <jerome.benoit@sap.com>
Thu, 2 Feb 2023 23:53:18 +0000 (00:53 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Thu, 2 Feb 2023 23:53:18 +0000 (00:53 +0100)
simulation

Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/charging-station/ChargingStation.ts
src/utils/Configuration.ts

index 79cf45b8a60166c3caa9cef671f921031956142d..54b3afab565f348d7a2577a1d76d181c504b32aa 100644 (file)
@@ -36,6 +36,7 @@ import type { ChargingStationOcppConfiguration } from '../types/ChargingStationO
 import {
   type ChargingStationTemplate,
   CurrentType,
+  type FirmwareUpgrade,
   PowerUnits,
   type WsOptions,
 } from '../types/ChargingStationTemplate';
@@ -890,8 +891,11 @@ export default class ChargingStation {
         } does not match firmware version pattern '${stationInfo.firmwareVersionPattern}'`
       );
     }
-    stationInfo.firmwareUpgrade = merge(
+    stationInfo.firmwareUpgrade = merge<FirmwareUpgrade>(
       {
+        versionUpgrade: {
+          step: 1,
+        },
         reset: true,
       },
       stationTemplate?.firmwareUpgrade ?? {}
index 209ce7746d45af9941efbd333b285d97ae46c115..2cba674d3dd523589e087c7143753588bf26efb3 100644 (file)
@@ -69,7 +69,10 @@ export default class Configuration {
       },
     };
     if (Configuration.objectHasOwnProperty(Configuration.getConfig(), 'uiServer')) {
-      uiServerConfiguration = merge(uiServerConfiguration, Configuration.getConfig()?.uiServer);
+      uiServerConfiguration = merge<UIServerConfiguration>(
+        uiServerConfiguration,
+        Configuration.getConfig()?.uiServer
+      );
     }
     if (Configuration.isCFEnvironment() === true) {
       delete uiServerConfiguration.options?.host;