From 7ffc14365e06809bde30fff5fd03fb022d7483f5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Thu, 23 Nov 2023 22:26:18 +0100 Subject: [PATCH] refactor: remove unneeded max power getter 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 | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/charging-station/ChargingStation.ts b/src/charging-station/ChargingStation.ts index 02200e41..988dc580 100644 --- a/src/charging-station/ChargingStation.ts +++ b/src/charging-station/ChargingStation.ts @@ -2056,8 +2056,8 @@ export class ChargingStation extends EventEmitter { return powerDivider; } - private getMaximumAmperage(stationInfo: ChargingStationInfo): number | undefined { - const maximumPower = this.getMaximumPower(stationInfo); + private getMaximumAmperage(stationInfo?: ChargingStationInfo): number | undefined { + const maximumPower = (stationInfo ?? this.stationInfo).maximumPower!; switch (this.getCurrentOutType(stationInfo)) { case CurrentType.AC: return ACElectricUtils.amperagePerPhaseFromPower( @@ -2070,10 +2070,6 @@ export class ChargingStation extends EventEmitter { } } - private getMaximumPower(stationInfo?: ChargingStationInfo): number { - return (stationInfo ?? this.stationInfo).maximumPower!; - } - private getCurrentOutType(stationInfo?: ChargingStationInfo): CurrentType { return (stationInfo ?? this.stationInfo).currentOutType ?? CurrentType.AC; } -- 2.34.1