+ if (
+ !isNullOrUndefined(chargingSchedule?.startSchedule) &&
+ isNullOrUndefined(chargingSchedule?.duration)
+ ) {
+ logger.debug(
+ `${logPrefix} ${moduleName}.getLimitFromChargingProfiles: Charging profile id ${chargingProfile.chargingProfileId} has no duration defined and will be set to the maximum time allowed`,
+ );
+ // OCPP specifies that if duration is not defined, it should be infinite
+ chargingSchedule.duration = differenceInSeconds(maxTime, chargingSchedule.startSchedule!);
+ }