X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcharging-station%2FHelpers.ts;h=63cc0f634e7b2bc6e066b126a2c63911030bb774;hb=0a96409ab6db51ef7b2e6e292216d12c926f7e9c;hp=9de547776ed470188274cc066bf7b51a3e09fea7;hpb=6fc0c6f3db444377c0fdea238183a14823278046;p=e-mobility-charging-stations-simulator.git diff --git a/src/charging-station/Helpers.ts b/src/charging-station/Helpers.ts index 9de54777..63cc0f63 100644 --- a/src/charging-station/Helpers.ts +++ b/src/charging-station/Helpers.ts @@ -734,7 +734,7 @@ interface ChargingProfilesLimit { } /** - * Charging profiles should already be sorted by connector id ascending then stack level descending + * Charging profiles shall already be sorted by connector id ascending then stack level descending * * @param chargingStation - * @param connectorId - @@ -751,12 +751,6 @@ const getLimitFromChargingProfiles = ( const debugLogMsg = `${logPrefix} ${moduleName}.getLimitFromChargingProfiles: Matching charging profile found for power limitation: %j`; const currentDate = new Date(); const connectorStatus = chargingStation.getConnectorStatus(connectorId)!; - if (!isArraySorted(chargingProfiles, (a, b) => b.stackLevel - a.stackLevel)) { - logger.warn( - `${logPrefix} ${moduleName}.getLimitFromChargingProfiles: Charging profiles are not sorted by stack level. Trying to sort them`, - ); - chargingProfiles.sort((a, b) => b.stackLevel - a.stackLevel); - } for (const chargingProfile of chargingProfiles) { const chargingSchedule = chargingProfile.chargingSchedule; if (connectorStatus?.transactionStarted && isNullOrUndefined(chargingSchedule?.startSchedule)) {