From 73de8f02dd0904bc16d7001509962fdad785db9b Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Fri, 10 Nov 2023 23:11:25 +0100 Subject: [PATCH] fix: fix stationInfo default values 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 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 { -- 2.34.1