From: Jérôme Benoit Date: Wed, 22 Mar 2023 19:25:14 +0000 (+0100) Subject: fix: ensure the incremented firmware version is saved in configuration X-Git-Tag: v1.2.0-0~31 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=6bccfcbcb7084b3a29469435bf87e89cb47d4218;p=e-mobility-charging-stations-simulator.git fix: ensure the incremented firmware version is saved in configuration Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/ChargingStation.ts b/src/charging-station/ChargingStation.ts index 6050a73e..81170bad 100644 --- a/src/charging-station/ChargingStation.ts +++ b/src/charging-station/ChargingStation.ts @@ -1015,17 +1015,6 @@ export class ChargingStation { `${ChargingStationUtils.getHashId(this.index, this.getTemplateFromFile())}.json` ); this.stationInfo = this.getStationInfo(); - this.saveStationInfo(); - // Avoid duplication of connectors related information in RAM - delete this.stationInfo?.Connectors; - this.configuredSupervisionUrl = this.getConfiguredSupervisionUrl(); - if (this.getEnableStatistics() === true) { - this.performanceStatistics = PerformanceStatistics.getInstance( - this.stationInfo.hashId, - this.stationInfo.chargingStationId, - this.configuredSupervisionUrl - ); - } if ( this.stationInfo.firmwareStatus === FirmwareStatus.Installing && Utils.isNotEmptyString(this.stationInfo.firmwareVersion) && @@ -1044,6 +1033,17 @@ export class ChargingStation { ).toString(); this.stationInfo.firmwareVersion = match?.join('.'); } + this.saveStationInfo(); + // Avoid duplication of connectors related information in RAM + delete this.stationInfo?.Connectors; + this.configuredSupervisionUrl = this.getConfiguredSupervisionUrl(); + if (this.getEnableStatistics() === true) { + this.performanceStatistics = PerformanceStatistics.getInstance( + this.stationInfo.hashId, + this.stationInfo.chargingStationId, + this.configuredSupervisionUrl + ); + } this.bootNotificationRequest = ChargingStationUtils.createBootNotificationRequest( this.stationInfo );