From 2ed9c7a844dd0ff83236dab693c18d2fad046310 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Mon, 24 Jul 2023 13:18:41 +0200 Subject: [PATCH] refactor: cleanup getLimitFromChargingProfiles() helper return type MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/charging-station/ChargingStationUtils.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/charging-station/ChargingStationUtils.ts b/src/charging-station/ChargingStationUtils.ts index 7865eb1f..749b876b 100644 --- a/src/charging-station/ChargingStationUtils.ts +++ b/src/charging-station/ChargingStationUtils.ts @@ -657,10 +657,12 @@ const convertDeprecatedTemplateKey = ( const getLimitFromChargingProfiles = ( chargingProfiles: ChargingProfile[], logPrefix: string, -): { - limit: number; - matchingChargingProfile: ChargingProfile; -} | null => { +): + | { + limit: number; + matchingChargingProfile: ChargingProfile; + } + | undefined => { const debugLogMsg = `${logPrefix} ${moduleName}.getLimitFromChargingProfiles: Matching charging profile found for power limitation: %j`; const currentDate = new Date(); for (const chargingProfile of chargingProfiles) { @@ -677,7 +679,6 @@ const getLimitFromChargingProfiles = ( ); chargingSchedule.startSchedule = convertToDate(chargingSchedule.startSchedule)!; } - // Check type (recurring) and if it is already active // Adjust the daily recurring schedule to today if ( chargingProfile.chargingProfileKind === ChargingProfileKindType.RECURRING && @@ -746,7 +747,6 @@ const getLimitFromChargingProfiles = ( } } } - return null; }; const getRandomSerialNumberSuffix = (params?: { -- 2.34.1