From 21ee4dc2dc59410c94c69d11c46ddf07c7298ff1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Thu, 3 Aug 2023 15:10:45 +0200 Subject: [PATCH] fix: tx charging profiles have precedence over the ones on connector 0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/charging-station/Helpers.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/charging-station/Helpers.ts b/src/charging-station/Helpers.ts index dd6bcee1..376199bf 100644 --- a/src/charging-station/Helpers.ts +++ b/src/charging-station/Helpers.ts @@ -517,7 +517,7 @@ export const getAmperageLimitationUnitDivider = (stationInfo: ChargingStationInf /** * Gets the connector cloned charging profiles applying a power limitation - * and sorted by connector id ascending then stack level descending + * and sorted by connector id descending then stack level descending * * @param chargingStation - * @param connectorId - @@ -528,10 +528,10 @@ export const getConnectorChargingProfiles = ( connectorId: number, ) => { return cloneObject( - (chargingStation.getConnectorStatus(0)?.chargingProfiles ?? []) + (chargingStation.getConnectorStatus(connectorId)?.chargingProfiles ?? []) .sort((a, b) => b.stackLevel - a.stackLevel) .concat( - (chargingStation.getConnectorStatus(connectorId)?.chargingProfiles ?? []).sort( + (chargingStation.getConnectorStatus(0)?.chargingProfiles ?? []).sort( (a, b) => b.stackLevel - a.stackLevel, ), ), @@ -735,7 +735,7 @@ interface ChargingProfilesLimit { } /** - * Charging profiles shall already be sorted by connector id ascending then stack level descending + * Charging profiles shall already be sorted by connector id descending then stack level descending * * @param chargingStation - * @param connectorId - -- 2.34.1