BootReasonEnumType,
type ChargingProfile,
ChargingProfileKindType,
+ ChargingProfilePurposeType,
ChargingRateUnitType,
type ChargingSchedulePeriod,
type ChargingStationConfiguration,
if (isNotEmptyArray(connectorStatus.chargingProfiles)) {
connectorStatus.chargingProfiles = connectorStatus.chargingProfiles.filter(
chargingProfile =>
+ chargingProfile.chargingProfilePurpose !== ChargingProfilePurposeType.TX_PROFILE ||
(chargingProfile.transactionId != null &&
connectorStatus.transactionId != null &&
- chargingProfile.transactionId !== connectorStatus.transactionId) ||
- chargingProfile.transactionId == null
+ chargingProfile.transactionId !== connectorStatus.transactionId)
)
}
resetAuthorizeConnectorStatus(connectorStatus)
csChargingProfiles.chargingProfilePurpose === OCPP16ChargingProfilePurposeType.TX_PROFILE &&
connectorId > 0 &&
connectorStatus?.transactionStarted === true &&
+ csChargingProfiles.transactionId != null &&
csChargingProfiles.transactionId !== connectorStatus.transactionId
) {
logger.error(
connectorId: number,
chargingProfile: OCPP16ChargingProfile
): boolean {
- if (chargingProfile.chargingProfilePurpose === OCPP16ChargingProfilePurposeType.TX_PROFILE) {
+ if (
+ chargingProfile.chargingProfilePurpose === OCPP16ChargingProfilePurposeType.TX_PROFILE &&
+ chargingProfile.transactionId == null
+ ) {
OCPP16ServiceUtils.setChargingProfile(chargingStation, connectorId, chargingProfile)
logger.debug(
`${chargingStation.logPrefix()} Charging profile(s) set at remote start transaction on ${
logger.debug(
`${chargingStation.logPrefix()} Not allowed to set ${
chargingProfile.chargingProfilePurpose
- } charging profile(s) at remote start transaction`
+ } charging profile(s)${chargingProfile.transactionId != null ? ' with transactionId set' : ''} at remote start transaction`
)
return false
}
export {
type ChargingProfile,
ChargingProfileKindType,
+ ChargingProfilePurposeType,
ChargingRateUnitType,
type ChargingSchedulePeriod,
RecurrencyKindType
import {
type OCPP16ChargingProfile,
OCPP16ChargingProfileKindType,
+ OCPP16ChargingProfilePurposeType,
OCPP16ChargingRateUnitType,
type OCPP16ChargingSchedulePeriod,
OCPP16RecurrencyKindType
export type ChargingSchedulePeriod = OCPP16ChargingSchedulePeriod
+export const ChargingProfilePurposeType = {
+ ...OCPP16ChargingProfilePurposeType
+} as const
+// eslint-disable-next-line @typescript-eslint/no-redeclare
+export type ChargingProfilePurposeType = OCPP16ChargingProfilePurposeType
+
export const ChargingProfileKindType = {
...OCPP16ChargingProfileKindType
} as const