From 947f048a4d756bbe346b943ff74cf6fb81837f9f Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Mon, 24 Jul 2023 20:31:26 +0200 Subject: [PATCH] refactor: add type for charging profiles limit 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 | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/charging-station/ChargingStationUtils.ts b/src/charging-station/ChargingStationUtils.ts index 6a64df3d..b33a5108 100644 --- a/src/charging-station/ChargingStationUtils.ts +++ b/src/charging-station/ChargingStationUtils.ts @@ -665,24 +665,24 @@ const convertDeprecatedTemplateKey = ( } }; +interface ChargingProfilesLimit { + limit: number; + matchingChargingProfile: ChargingProfile; +} + /** * Charging profiles should already be sorted by connector id and stack level (highest stack level has priority) * * @param chargingProfiles - * @param logPrefix - - * @returns + * @returns ChargingProfilesLimit */ const getLimitFromChargingProfiles = ( chargingStation: ChargingStation, connectorId: number, chargingProfiles: ChargingProfile[], logPrefix: string, -): - | { - limit: number; - matchingChargingProfile: ChargingProfile; - } - | undefined => { +): ChargingProfilesLimit | undefined => { const debugLogMsg = `${logPrefix} ${moduleName}.getLimitFromChargingProfiles: Matching charging profile found for power limitation: %j`; const currentDate = new Date(); for (const chargingProfile of chargingProfiles) { -- 2.34.1