Fix maximun charging station amperage calculation
authorJérôme Benoit <jerome.benoit@sap.com>
Fri, 18 Mar 2022 15:17:11 +0000 (16:17 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Fri, 18 Mar 2022 15:17:11 +0000 (16:17 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/charging-station/ChargingStation.ts

index 5f5de2dc7b5b84334aaf2dfe0fe021cf9872ecc4..55b58794c7be56faf6223c8344bc64b729f10756 100644 (file)
@@ -1591,8 +1591,8 @@ export default class ChargingStation {
       case CurrentType.AC:
         return ACElectricUtils.amperagePerPhaseFromPower(
           this.getNumberOfPhases(),
-          (this.stationInfo['maxPower'] as number) ??
-            this.stationInfo.maximumPower / this.getNumberOfConnectors(),
+          ((this.stationInfo['maxPower'] as number) ?? this.stationInfo.maximumPower) /
+            this.getNumberOfConnectors(),
           this.getVoltageOut()
         );
       case CurrentType.DC: