From: Jérôme Benoit Date: Fri, 3 Feb 2023 13:46:07 +0000 (+0100) Subject: refactor(simulator): remove unneeded intermediate variable in firmware X-Git-Tag: v1.1.93~15 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=07c52a72c0b8ab72dc37241892e02b229e70c0f6;p=e-mobility-charging-stations-simulator.git refactor(simulator): remove unneeded intermediate variable in firmware upgrade simulation code Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/ChargingStation.ts b/src/charging-station/ChargingStation.ts index 54b3afab..0de7ab93 100644 --- a/src/charging-station/ChargingStation.ts +++ b/src/charging-station/ChargingStation.ts @@ -1040,7 +1040,6 @@ export default class ChargingStation { !Utils.isEmptyString(this.stationInfo.firmwareVersion) && !Utils.isEmptyString(this.stationInfo.firmwareVersionPattern) ) { - const versionStep = this.stationInfo.firmwareUpgrade?.versionUpgrade?.step ?? 1; const patternGroup: number | undefined = this.stationInfo.firmwareUpgrade?.versionUpgrade?.patternGroup ?? this.stationInfo.firmwareVersion?.split('.').length; @@ -1049,7 +1048,8 @@ export default class ChargingStation { ?.slice(1, patternGroup + 1); const patchLevelIndex = match.length - 1; match[patchLevelIndex] = ( - Utils.convertToInt(match[patchLevelIndex]) + versionStep + Utils.convertToInt(match[patchLevelIndex]) + + this.stationInfo.firmwareUpgrade?.versionUpgrade?.step ).toString(); this.stationInfo.firmwareVersion = match?.join('.'); }