From: Jérôme Benoit Date: Wed, 22 Mar 2023 19:10:03 +0000 (+0100) Subject: fix(simulator): increment the firmware version in boot notification X-Git-Tag: v1.2.0-0~32 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=692f2f64aed9c4b79f43036c3318566484410b33;p=e-mobility-charging-stations-simulator.git fix(simulator): increment the firmware version in boot notification after upgrade simulation Signed-off-by: Jérôme Benoit --- 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 };