From: Jérôme Benoit Date: Fri, 10 Nov 2023 22:11:25 +0000 (+0100) Subject: fix: fix stationInfo default values X-Git-Tag: v1.2.24~18 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=73de8f02dd0904bc16d7001509962fdad785db9b;p=e-mobility-charging-stations-simulator.git fix: fix stationInfo default values Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/ChargingStation.ts b/src/charging-station/ChargingStation.ts index 282b6aef..0dce59fb 100644 --- a/src/charging-station/ChargingStation.ts +++ b/src/charging-station/ChargingStation.ts @@ -228,7 +228,6 @@ export class ChargingStation extends EventEmitter { public get stationInfo(): ChargingStationInfo { return { - ...this.internalStationInfo, ...{ enableStatistics: false, remoteAuthorization: true, @@ -252,6 +251,7 @@ export class ChargingStation extends EventEmitter { reconnectExponentialDelay: false, stopTransactionsOnStopped: true, }, + ...this.internalStationInfo, }; } @@ -1129,6 +1129,7 @@ export class ChargingStation extends EventEmitter { ? stationTemplate.power * 1000 : stationTemplate.power; } + stationInfo.maximumAmperage = this.getMaximumAmperage(stationInfo); stationInfo.firmwareVersionPattern = stationTemplate?.firmwareVersionPattern ?? Constants.SEMVER_PATTERN; if ( @@ -1153,7 +1154,6 @@ export class ChargingStation extends EventEmitter { stationInfo.resetTime = !isNullOrUndefined(stationTemplate?.resetTime) ? secondsToMilliseconds(stationTemplate.resetTime!) : Constants.CHARGING_STATION_DEFAULT_RESET_TIME; - stationInfo.maximumAmperage = this.getMaximumAmperage(stationInfo); return stationInfo; } @@ -2062,7 +2062,7 @@ export class ChargingStation extends EventEmitter { } private getCurrentOutType(stationInfo?: ChargingStationInfo): CurrentType { - return (stationInfo ?? this.stationInfo).currentOutType!; + return (stationInfo ?? this.stationInfo).currentOutType ?? CurrentType.AC; } private getVoltageOut(stationInfo?: ChargingStationInfo): number {