From 692f2f64aed9c4b79f43036c3318566484410b33 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Wed, 22 Mar 2023 20:10:03 +0100 Subject: [PATCH] fix(simulator): increment the firmware version in boot notification after upgrade simulation MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/charging-station/ChargingStation.ts | 30 +++++++++---------- .../ChargingStationConfigurationUtils.ts | 2 +- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/charging-station/ChargingStation.ts b/src/charging-station/ChargingStation.ts index 59a625e8..6050a73e 100644 --- a/src/charging-station/ChargingStation.ts +++ b/src/charging-station/ChargingStation.ts @@ -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 { diff --git a/src/charging-station/ChargingStationConfigurationUtils.ts b/src/charging-station/ChargingStationConfigurationUtils.ts index f3f043cf..579e2ab4 100644 --- a/src/charging-station/ChargingStationConfigurationUtils.ts +++ b/src/charging-station/ChargingStationConfigurationUtils.ts @@ -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 }; -- 2.34.1