+ if (
+ chargingProfile.chargingSchedule?.startSchedule != null &&
+ chargingProfile.chargingSchedule?.duration == null
+ ) {
+ logger.debug(
+ `${chargingStation.logPrefix()} ${moduleName}.handleRequestGetCompositeSchedule: 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
+ chargingProfile.chargingSchedule.duration = differenceInSeconds(
+ maxTime,
+ chargingProfile.chargingSchedule.startSchedule
+ )
+ }
+ if (
+ !prepareChargingProfileKind(
+ connectorStatus,
+ chargingProfile,
+ compositeScheduleInterval.start as Date,
+ chargingStation.logPrefix()
+ )
+ ) {
+ continue
+ }
+ if (
+ !canProceedChargingProfile(
+ chargingProfile,
+ compositeScheduleInterval.start as Date,
+ chargingStation.logPrefix()
+ )
+ ) {
+ continue
+ }
+ compositeSchedule = OCPP16ServiceUtils.composeChargingSchedules(
+ previousCompositeSchedule,
+ chargingProfile.chargingSchedule,
+ compositeScheduleInterval
+ )
+ previousCompositeSchedule = compositeSchedule