From: Jérôme Benoit Date: Thu, 23 Nov 2023 21:26:18 +0000 (+0100) Subject: refactor: remove unneeded max power getter X-Git-Tag: v1.2.26~4 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=7ffc14365e06809bde30fff5fd03fb022d7483f5;p=e-mobility-charging-stations-simulator.git refactor: remove unneeded max power getter Signed-off-by: Jérôme Benoit --- 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; }