type OCPP16SupportedFeatureProfiles,
OCPPVersion
} from '../../../types/index.js'
-import { isNotEmptyArray, logger, roundTo } from '../../../utils/index.js'
+import { convertToDate, isNotEmptyArray, logger, roundTo } from '../../../utils/index.js'
import { OCPPServiceUtils } from '../OCPPServiceUtils.js'
export class OCPP16ServiceUtils extends OCPPServiceUtils {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
chargingStation.getConnectorStatus(connectorId)!.chargingProfiles = []
}
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
+ cp.chargingSchedule.startSchedule = convertToDate(cp.chargingSchedule.startSchedule)!
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
+ cp.validFrom = convertToDate(cp.validFrom)!
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
+ cp.validTo = convertToDate(cp.validTo)!
let cpReplaced = false
if (isNotEmptyArray(chargingStation.getConnectorStatus(connectorId)?.chargingProfiles)) {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const { id, chargingProfilePurpose, stackLevel } = commandPayload
let clearedCP = false
if (isNotEmptyArray(chargingProfiles)) {
- chargingProfiles?.forEach((chargingProfile: OCPP16ChargingProfile, index: number) => {
+ chargingProfiles.forEach((chargingProfile: OCPP16ChargingProfile, index: number) => {
let clearCurrentCP = false
if (chargingProfile.chargingProfileId === id) {
clearCurrentCP = true