logger.error(
`${this.logPrefix()} Charging profile id ${
matchingChargingProfile.chargingProfileId
- } limit ${limit} is greater than connector id ${connectorId} maximum ${connectorMaximumPower}, dump charging profiles' stack: %j`,
- this.getConnectorStatus(connectorId).chargingProfiles
+ } limit ${limit} is greater than connector id ${connectorId} maximum ${connectorMaximumPower}: %j`,
+ this.getConnectorStatus(connectorId).chargingProfiles.find(
+ (chargingProfile) =>
+ chargingProfile.chargingProfileId === matchingChargingProfile.chargingProfileId
+ )
);
limit = connectorMaximumPower;
}
logger.debug(
`${chargingStation.logPrefix()} Charging profile(s) set on connector id ${
commandPayload.connectorId
- }, dump their stack: %j`,
- chargingStation.getConnectorStatus(commandPayload.connectorId).chargingProfiles
+ }: %j`,
+ commandPayload.csChargingProfiles
);
return OCPPConstants.OCPP_SET_CHARGING_PROFILE_RESPONSE_ACCEPTED;
}
logger.debug(
`${chargingStation.logPrefix()} Charging profile(s) cleared on connector id ${
commandPayload.connectorId
- }, dump their stack: %j`,
- connectorStatus.chargingProfiles
+ }`
);
return OCPPConstants.OCPP_CLEAR_CHARGING_PROFILE_RESPONSE_ACCEPTED;
}
if (clearCurrentCP) {
connectorStatus.chargingProfiles.splice(index, 1);
logger.debug(
- `${chargingStation.logPrefix()} Matching charging profile(s) cleared on connector id ${
- commandPayload.connectorId
- }, dump their stack: %j`,
- connectorStatus.chargingProfiles
+ `${chargingStation.logPrefix()} Matching charging profile(s) cleared: %j`,
+ chargingProfile
);
clearedCP = true;
}
if (cp && cp.chargingProfilePurpose === ChargingProfilePurposeType.TX_PROFILE) {
OCPP16ServiceUtils.setChargingProfile(chargingStation, connectorId, cp);
logger.debug(
- `${chargingStation.logPrefix()} Charging profile(s) set at remote start transaction on connector id ${connectorId}, dump their stack: %j`,
- chargingStation.getConnectorStatus(connectorId).chargingProfiles
+ `${chargingStation.logPrefix()} Charging profile(s) set at remote start transaction on connector id ${connectorId}: %j`,
+ cp
);
return true;
} else if (cp && cp.chargingProfilePurpose !== ChargingProfilePurposeType.TX_PROFILE) {