X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcharging-station%2Focpp%2F1.6%2FOCPP16ServiceUtils.ts;h=d9144064003fb5bf07e0443720e17ac2af084501;hb=0320e2bb72ca522c3932850cce0601ab0a895ad3;hp=1ffd6f5efc5af45114a0a311285e0c9aa4e328ce;hpb=3423c8a57047b3da28558538712aca35611c8214;p=e-mobility-charging-stations-simulator.git diff --git a/src/charging-station/ocpp/1.6/OCPP16ServiceUtils.ts b/src/charging-station/ocpp/1.6/OCPP16ServiceUtils.ts index 1ffd6f5e..d9144064 100644 --- a/src/charging-station/ocpp/1.6/OCPP16ServiceUtils.ts +++ b/src/charging-station/ocpp/1.6/OCPP16ServiceUtils.ts @@ -2,16 +2,15 @@ import type { JSONSchemaType } from 'ajv' import { - type Interval, addSeconds, areIntervalsOverlapping, differenceInSeconds, + type Interval, isAfter, isBefore, isWithinInterval } from 'date-fns' -import { OCPP16Constants } from './OCPP16Constants.js' import { type ChargingStation, hasFeatureProfile, @@ -40,6 +39,7 @@ import { } from '../../../types/index.js' import { convertToDate, isNotEmptyArray, logger, roundTo } from '../../../utils/index.js' import { OCPPServiceUtils } from '../OCPPServiceUtils.js' +import { OCPP16Constants } from './OCPP16Constants.js' export class OCPP16ServiceUtils extends OCPPServiceUtils { public static checkFeatureProfile ( @@ -507,8 +507,7 @@ export class OCPP16ServiceUtils extends OCPPServiceUtils { .filter((schedulePeriod, index) => { if ( isWithinInterval( - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - addSeconds(chargingScheduleInterval.start, schedulePeriod.startPeriod)!, + addSeconds(chargingScheduleInterval.start, schedulePeriod.startPeriod), compositeInterval ) ) { @@ -549,8 +548,7 @@ export class OCPP16ServiceUtils extends OCPPServiceUtils { ), chargingSchedulePeriod: chargingSchedule.chargingSchedulePeriod.filter(schedulePeriod => isWithinInterval( - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - addSeconds(chargingScheduleInterval.start, schedulePeriod.startPeriod)!, + addSeconds(chargingScheduleInterval.start, schedulePeriod.startPeriod), compositeInterval ) )