fix(simulator): increment the firmware version in boot notification
authorJérôme Benoit <jerome.benoit@sap.com>
Wed, 22 Mar 2023 19:10:03 +0000 (20:10 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Wed, 22 Mar 2023 19:10:03 +0000 (20:10 +0100)
after upgrade simulation

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

index 59a625e8693e8ee107f214e58e8b6990a8d48d43..6050a73efee3b0402212f1d4d5da34174d4a238b 100644 (file)
@@ -1026,21 +1026,6 @@ export class ChargingStation {
         this.configuredSupervisionUrl
       );
     }
-    this.bootNotificationRequest = ChargingStationUtils.createBootNotificationRequest(
-      this.stationInfo
-    );
-    this.powerDivider = this.getPowerDivider();
-    // OCPP configuration
-    this.ocppConfiguration = this.getOcppConfiguration();
-    this.initializeOcppConfiguration();
-    this.initializeOcppServices();
-    if (this.stationInfo?.autoRegister === true) {
-      this.bootNotificationResponse = {
-        currentTime: new Date(),
-        interval: this.getHeartbeatInterval() / 1000,
-        status: RegistrationStatusEnumType.ACCEPTED,
-      };
-    }
     if (
       this.stationInfo.firmwareStatus === FirmwareStatus.Installing &&
       Utils.isNotEmptyString(this.stationInfo.firmwareVersion) &&
@@ -1059,6 +1044,21 @@ export class ChargingStation {
       ).toString();
       this.stationInfo.firmwareVersion = match?.join('.');
     }
+    this.bootNotificationRequest = ChargingStationUtils.createBootNotificationRequest(
+      this.stationInfo
+    );
+    this.powerDivider = this.getPowerDivider();
+    // OCPP configuration
+    this.ocppConfiguration = this.getOcppConfiguration();
+    this.initializeOcppConfiguration();
+    this.initializeOcppServices();
+    if (this.stationInfo?.autoRegister === true) {
+      this.bootNotificationResponse = {
+        currentTime: new Date(),
+        interval: this.getHeartbeatInterval() / 1000,
+        status: RegistrationStatusEnumType.ACCEPTED,
+      };
+    }
   }
 
   private initializeOcppServices(): void {
index f3f043cfb4a2bf509f0ac11699571d1bbd13e973..579e2ab49f2f129f5a7e362768636b39070ed7b0 100644 (file)
@@ -1,6 +1,6 @@
 import type { ChargingStation } from './internal';
 import type { ConfigurationKey, ConfigurationKeyType } from '../types';
-import { Constants, logger } from '../utils';
+import { logger } from '../utils';
 
 type ConfigurationKeyOptions = { readonly?: boolean; visible?: boolean; reboot?: boolean };
 type DeleteConfigurationKeyParams = { save?: boolean; caseInsensitive?: boolean };