.then(response => {
if (response.idTagInfo.status === OCPP16AuthorizationStatus.ACCEPTED) {
logger.debug(
- `${chargingStation.logPrefix()} Remote start transaction ACCEPTED on ${
+ `${chargingStation.logPrefix()} ${moduleName}.constructor: Remote start transaction ACCEPTED on ${
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
chargingStation.stationInfo?.chargingStationId
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
)
} else {
logger.debug(
- `${chargingStation.logPrefix()} Remote start transaction REJECTED on ${
+ `${chargingStation.logPrefix()} ${moduleName}.constructor: Remote start transaction REJECTED on ${
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
chargingStation.stationInfo?.chargingStationId
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
.then(response => {
if (response.status === GenericStatus.Accepted) {
logger.debug(
- `${chargingStation.logPrefix()} Remote stop transaction ACCEPTED on ${
+ `${chargingStation.logPrefix()} ${moduleName}.constructor: Remote stop transaction ACCEPTED on ${
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
chargingStation.stationInfo?.chargingStationId
}#${connectorId.toString()} for transaction '${transactionId.toString()}'`
)
} else {
logger.debug(
- `${chargingStation.logPrefix()} Remote stop transaction REJECTED on ${
+ `${chargingStation.logPrefix()} ${moduleName}.constructor: Remote stop transaction REJECTED on ${
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
chargingStation.stationInfo?.chargingStationId
}#${connectorId.toString()} for transaction '${transactionId.toString()}'`
const reservation = chargingStation.getReservationBy('reservationId', reservationId)
if (reservation == null) {
logger.debug(
- `${chargingStation.logPrefix()} Reservation with id ${reservationId.toString()} does not exist on charging station`
+ `${chargingStation.logPrefix()} ${moduleName}.handleRequestCancelReservation: Reservation with id ${reservationId.toString()} does not exist on charging station`
)
return OCPP16Constants.OCPP_CANCEL_RESERVATION_RESPONSE_REJECTED
}
const { connectorId, type } = commandPayload
if (!chargingStation.hasConnector(connectorId)) {
logger.error(
- `${chargingStation.logPrefix()} Trying to change the availability of a non existing connector id ${connectorId.toString()}`
+ `${chargingStation.logPrefix()} ${moduleName}.handleRequestChangeAvailability: Trying to change the availability of a non existing connector id ${connectorId.toString()}`
)
return OCPP16Constants.OCPP_AVAILABILITY_RESPONSE_REJECTED
}
if (connectorId != null) {
if (!chargingStation.hasConnector(connectorId)) {
logger.error(
- `${chargingStation.logPrefix()} Trying to clear a charging profile(s) to a non existing connector id ${connectorId.toString()}`
+ `${chargingStation.logPrefix()} ${moduleName}.handleRequestClearChargingProfile: Trying to clear a charging profile(s) to a non existing connector id ${connectorId.toString()}`
)
return OCPP16Constants.OCPP_CLEAR_CHARGING_PROFILE_RESPONSE_UNKNOWN
}
if (isNotEmptyArray(connectorStatus?.chargingProfiles)) {
connectorStatus.chargingProfiles = []
logger.debug(
- `${chargingStation.logPrefix()} Charging profile(s) cleared on connector id ${connectorId.toString()}`
+ `${chargingStation.logPrefix()} ${moduleName}.handleRequestClearChargingProfile: Charging profile(s) cleared on connector id ${connectorId.toString()}`
)
return OCPP16Constants.OCPP_CLEAR_CHARGING_PROFILE_RESPONSE_ACCEPTED
}
const { chargingRateUnit, connectorId, duration } = commandPayload
if (!chargingStation.hasConnector(connectorId)) {
logger.error(
- `${chargingStation.logPrefix()} Trying to get composite schedule to a non existing connector id ${connectorId.toString()}`
+ `${chargingStation.logPrefix()} ${moduleName}.handleRequestGetCompositeSchedule: Trying to get composite schedule to a non existing connector id ${connectorId.toString()}`
)
return OCPP16Constants.OCPP_RESPONSE_REJECTED
}
if (connectorId === 0) {
logger.error(
- `${chargingStation.logPrefix()} Get composite schedule on connector id ${connectorId.toString()} is not yet supported`
+ `${chargingStation.logPrefix()} ${moduleName}.handleRequestGetCompositeSchedule: Get composite schedule on connector id ${connectorId.toString()} is not yet supported`
)
return OCPP16Constants.OCPP_RESPONSE_REJECTED
}
if (chargingRateUnit != null) {
logger.warn(
- `${chargingStation.logPrefix()} Get composite schedule with a specified rate unit is not yet supported, no conversion will be done`
+ `${chargingStation.logPrefix()} ${moduleName}.handleRequestGetCompositeSchedule: Get composite schedule with a specified rate unit is not yet supported, no conversion will be done`
)
}
const connectorStatus = chargingStation.getConnectorStatus(connectorId)
}
} else {
logger.error(
- `${chargingStation.logPrefix()} Unsupported protocol ${
+ `${chargingStation.logPrefix()} ${moduleName}.handleRequestGetDiagnostics: Unsupported protocol ${
uri.protocol
} to transfer the diagnostic logs archive`
)
}
if (commandPayload.connectorId == null) {
logger.debug(
- `${chargingStation.logPrefix()} Remote start transaction REJECTED on ${
+ `${chargingStation.logPrefix()} ${moduleName}.handleRequestRemoteStartTransaction: Remote start transaction REJECTED on ${
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
chargingStation.stationInfo?.chargingStationId
}, idTag '${commandPayload.idTag}': no available connector found`
)
}
logger.debug(
- `${chargingStation.logPrefix()} Remote start transaction ACCEPTED on ${
+ `${chargingStation.logPrefix()} ${moduleName}.handleRequestRemoteStartTransaction: Remote start transaction ACCEPTED on ${
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
chargingStation.stationInfo?.chargingStationId
- }#${transactionConnectorId.toString()}}, idTag '${idTag}'`
+ }#${transactionConnectorId.toString()}, idTag '${idTag}'`
)
return OCPP16Constants.OCPP_RESPONSE_ACCEPTED
}
const { transactionId } = commandPayload
if (chargingStation.getConnectorIdByTransactionId(transactionId) != null) {
logger.debug(
- `${chargingStation.logPrefix()} Remote stop transaction ACCEPTED for transactionId '${transactionId.toString()}'`
+ `${chargingStation.logPrefix()} ${moduleName}.handleRequestRemoteStopTransaction: Remote stop transaction ACCEPTED for transactionId '${transactionId.toString()}'`
)
return OCPP16Constants.OCPP_RESPONSE_ACCEPTED
}
logger.debug(
- `${chargingStation.logPrefix()} Remote stop transaction REJECTED for transactionId '${transactionId.toString()}'`
+ `${chargingStation.logPrefix()} ${moduleName}.handleRequestRemoteStopTransaction: Remote stop transaction REJECTED for transactionId '${transactionId.toString()}'`
)
return OCPP16Constants.OCPP_RESPONSE_REJECTED
}
const { connectorId, idTag, reservationId } = commandPayload
if (!chargingStation.hasConnector(connectorId)) {
logger.error(
- `${chargingStation.logPrefix()} Trying to reserve a non existing connector id ${connectorId.toString()}`
+ `${chargingStation.logPrefix()} ${moduleName}.handleRequestReserveNow: Trying to reserve a non existing connector id ${connectorId.toString()}`
)
return OCPP16Constants.OCPP_RESERVATION_RESPONSE_REJECTED
}
.reset(`${type}Reset` as OCPP16StopTransactionReason)
.catch(Constants.EMPTY_FUNCTION)
logger.info(
- `${chargingStation.logPrefix()} ${type} reset command received, simulating it. The station will be back online in ${formatDurationMilliSeconds(
+ `${chargingStation.logPrefix()} ${moduleName}.handleRequestReset: ${type} reset command received, simulating it. The station will be back online in ${formatDurationMilliSeconds(
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
chargingStation.stationInfo!.resetTime!
)}`
const { connectorId, csChargingProfiles } = commandPayload
if (!chargingStation.hasConnector(connectorId)) {
logger.error(
- `${chargingStation.logPrefix()} Trying to set charging profile(s) to a non existing connector id ${connectorId.toString()}`
+ `${chargingStation.logPrefix()} ${moduleName}.handleRequestSetChargingProfile: Trying to set charging profile(s) to a non existing connector id ${connectorId.toString()}`
)
return OCPP16Constants.OCPP_SET_CHARGING_PROFILE_RESPONSE_REJECTED
}
connectorId === 0
) {
logger.error(
- `${chargingStation.logPrefix()} Trying to set transaction charging profile(s) on connector ${connectorId.toString()}`
+ `${chargingStation.logPrefix()} ${moduleName}.handleRequestSetChargingProfile: Trying to set transaction charging profile(s) on connector ${connectorId.toString()}`
)
return OCPP16Constants.OCPP_SET_CHARGING_PROFILE_RESPONSE_REJECTED
}
connectorStatus?.transactionStarted === false
) {
logger.error(
- `${chargingStation.logPrefix()} Trying to set transaction charging profile(s) on connector ${connectorId.toString()} without a started transaction`
+ `${chargingStation.logPrefix()} ${moduleName}.handleRequestSetChargingProfile: Trying to set transaction charging profile(s) on connector ${connectorId.toString()} without a started transaction`
)
return OCPP16Constants.OCPP_SET_CHARGING_PROFILE_RESPONSE_REJECTED
}
csChargingProfiles.transactionId !== connectorStatus.transactionId
) {
logger.error(
- `${chargingStation.logPrefix()} Trying to set transaction charging profile(s) on connector ${connectorId.toString()} with a different transaction id ${
+ `${chargingStation.logPrefix()} ${moduleName}.handleRequestSetChargingProfile: Trying to set transaction charging profile(s) on connector ${connectorId.toString()} with a different transaction id ${
csChargingProfiles.transactionId.toString()
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
} than the started transaction id ${connectorStatus.transactionId?.toString()}`
}
OCPP16ServiceUtils.setChargingProfile(chargingStation, connectorId, csChargingProfiles)
logger.debug(
- `${chargingStation.logPrefix()} Charging profile(s) set on connector id ${connectorId.toString()}: %j`,
+ `${chargingStation.logPrefix()} ${moduleName}.handleRequestSetChargingProfile: Charging profile(s) set on connector id ${connectorId.toString()}: %j`,
csChargingProfiles
)
return OCPP16Constants.OCPP_SET_CHARGING_PROFILE_RESPONSE_ACCEPTED
const { connectorId } = commandPayload
if (!chargingStation.hasConnector(connectorId)) {
logger.error(
- `${chargingStation.logPrefix()} Trying to unlock a non existing connector id ${connectorId.toString()}`
+ `${chargingStation.logPrefix()} ${moduleName}.handleRequestUnlockConnector: Trying to unlock a non existing connector id ${connectorId.toString()}`
)
return OCPP16Constants.OCPP_RESPONSE_UNLOCK_NOT_SUPPORTED
}
if (connectorId === 0) {
logger.error(
- `${chargingStation.logPrefix()} Trying to unlock connector id ${connectorId.toString()}`
+ `${chargingStation.logPrefix()} ${moduleName}.handleRequestUnlockConnector: Trying to unlock connector id ${connectorId.toString()}`
)
return OCPP16Constants.OCPP_RESPONSE_UNLOCK_NOT_SUPPORTED
}
): GenericResponse {
const connectorStatus = chargingStation.getConnectorStatus(connectorId)
logger.debug(
- `${chargingStation.logPrefix()} Remote start transaction REJECTED on ${
+ `${chargingStation.logPrefix()} ${moduleName}.notifyRemoteStartTransactionRejected: Remote start transaction REJECTED on ${
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
chargingStation.stationInfo?.chargingStationId
}#${connectorId.toString()}, idTag '${idTag}', availability '${
) {
OCPP16ServiceUtils.setChargingProfile(chargingStation, connectorId, chargingProfile)
logger.debug(
- `${chargingStation.logPrefix()} Charging profile(s) set at remote start transaction on ${
+ `${chargingStation.logPrefix()} ${moduleName}.setRemoteStartTransactionChargingProfile: Charging profile(s) set at remote start transaction on ${
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
chargingStation.stationInfo?.chargingStationId
}#${connectorId.toString()}`,
return true
}
logger.debug(
- `${chargingStation.logPrefix()} Not allowed to set ${
+ `${chargingStation.logPrefix()} ${moduleName}.setRemoteStartTransactionChargingProfile: Not allowed to set ${
chargingProfile.chargingProfilePurpose
} charging profile(s)${chargingProfile.transactionId != null ? ' with transactionId set' : ''} at remote start transaction`
)
if (payload.idTagInfo.status === OCPP16AuthorizationStatus.ACCEPTED) {
authorizeConnectorStatus.idTagAuthorized = true
logger.debug(
- `${chargingStation.logPrefix()} idTag '${
+ `${chargingStation.logPrefix()} ${moduleName}.handleResponseAuthorize: idTag '${
requestPayload.idTag
}' accepted on connector id ${authorizeConnectorId.toString()}`
)
authorizeConnectorStatus.idTagAuthorized = false
delete authorizeConnectorStatus.authorizeIdTag
logger.debug(
- `${chargingStation.logPrefix()} idTag '${
+ `${chargingStation.logPrefix()} ${moduleName}.handleResponseAuthorize: idTag '${
requestPayload.idTag
}' rejected with status '${payload.idTagInfo.status}'`
)
}
} else {
logger.error(
- `${chargingStation.logPrefix()} idTag '${
+ `${chargingStation.logPrefix()} ${moduleName}.handleResponseAuthorize: idTag '${
requestPayload.idTag
}' has no authorize request pending`
)
} else if (chargingStation.inRejectedState()) {
chargingStation.emitChargingStationEvent(ChargingStationEvents.rejected)
}
- const logMsg = `${chargingStation.logPrefix()} Charging station in '${
+ const logMsg = `${chargingStation.logPrefix()} ${moduleName}.handleResponseBootNotification: Charging station in '${
payload.status
}' state on the central server`
payload.status === RegistrationStatusEnumType.REJECTED
} else {
delete chargingStation.bootNotificationResponse
logger.error(
- `${chargingStation.logPrefix()} Charging station boot notification response received: %j with undefined registration status`,
+ `${chargingStation.logPrefix()} ${moduleName}.handleResponseBootNotification: Charging station boot notification response received: %j with undefined registration status`,
payload
)
}
const { connectorId } = requestPayload
if (connectorId === 0 || !chargingStation.hasConnector(connectorId)) {
logger.error(
- `${chargingStation.logPrefix()} Trying to start a transaction on a non existing connector id ${connectorId.toString()}`
+ `${chargingStation.logPrefix()} ${moduleName}.handleResponseStartTransaction: Trying to start a transaction on a non existing connector id ${connectorId.toString()}`
)
return
}
connectorStatus.idTagLocalAuthorized === false
) {
logger.error(
- `${chargingStation.logPrefix()} Trying to start a transaction with a not local authorized idTag ${
+ `${chargingStation.logPrefix()} ${moduleName}.handleResponseStartTransaction: Trying to start a transaction with a not local authorized idTag ${
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
connectorStatus.localAuthorizeIdTag
} on connector id ${connectorId.toString()}`
connectorStatus.idTagAuthorized === false
) {
logger.error(
- `${chargingStation.logPrefix()} Trying to start a transaction with a not authorized idTag ${
+ `${chargingStation.logPrefix()} ${moduleName}.handleResponseStartTransaction: Trying to start a transaction with a not authorized idTag ${
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
connectorStatus.authorizeIdTag
} on connector id ${connectorId.toString()}`
connectorStatus.authorizeIdTag !== requestPayload.idTag
) {
logger.error(
- `${chargingStation.logPrefix()} Trying to start a transaction with an idTag ${
+ `${chargingStation.logPrefix()} ${moduleName}.handleResponseStartTransaction: Trying to start a transaction with an idTag ${
requestPayload.idTag
} different from the authorize request one ${
connectorStatus.authorizeIdTag
connectorStatus.localAuthorizeIdTag !== requestPayload.idTag
) {
logger.error(
- `${chargingStation.logPrefix()} Trying to start a transaction with an idTag ${
+ `${chargingStation.logPrefix()} ${moduleName}.handleResponseStartTransaction: Trying to start a transaction with an idTag ${
requestPayload.idTag
} different from the local authorized one ${
connectorStatus.localAuthorizeIdTag
}
if (connectorStatus?.transactionStarted === true) {
logger.error(
- `${chargingStation.logPrefix()} Trying to start a transaction on an already used connector id ${connectorId.toString()} by idTag ${
+ `${chargingStation.logPrefix()} ${moduleName}.handleResponseStartTransaction: Trying to start a transaction on an already used connector id ${connectorId.toString()} by idTag ${
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
connectorStatus.transactionIdTag
}`
for (const [id, status] of evseStatus.connectors) {
if (id !== connectorId && status.transactionStarted === true) {
logger.error(
- `${chargingStation.logPrefix()} Trying to start a transaction on an already used evse id ${evseId.toString()} by connector id ${id.toString()} with idTag ${
+ `${chargingStation.logPrefix()} ${moduleName}.handleResponseStartTransaction: Trying to start a transaction on an already used evse id ${evseId.toString()} by connector id ${id.toString()} with idTag ${
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
status.transactionIdTag
}`
connectorStatus?.status !== OCPP16ChargePointStatus.Preparing
) {
logger.error(
- `${chargingStation.logPrefix()} Trying to start a transaction on connector id ${connectorId.toString()} with status ${
+ `${chargingStation.logPrefix()} ${moduleName}.handleResponseStartTransaction: Trying to start a transaction on connector id ${connectorId.toString()} with status ${
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
connectorStatus?.status
}`
}
if (!Number.isSafeInteger(payload.transactionId)) {
logger.warn(
- `${chargingStation.logPrefix()} Trying to start a transaction on connector id ${connectorId.toString()} with a non integer transaction id ${payload.transactionId.toString()}, converting to integer`
+ `${chargingStation.logPrefix()} ${moduleName}.handleResponseStartTransaction: Trying to start a transaction on connector id ${connectorId.toString()} with a non integer transaction id ${payload.transactionId.toString()}, converting to integer`
)
payload.transactionId = convertToInt(payload.transactionId)
}
if (reservation != null) {
if (reservation.idTag !== requestPayload.idTag) {
logger.warn(
- `${chargingStation.logPrefix()} Reserved transaction ${payload.transactionId.toString()} started with a different idTag ${
+ `${chargingStation.logPrefix()} ${moduleName}.handleResponseStartTransaction: Reserved transaction ${payload.transactionId.toString()} started with a different idTag ${
requestPayload.idTag
} than the reservation one ${reservation.idTag}`
)
}
if (hasReservationExpired(reservation)) {
logger.warn(
- `${chargingStation.logPrefix()} Reserved transaction ${payload.transactionId.toString()} started with expired reservation ${requestPayload.reservationId.toString()} (expiry date: ${reservation.expiryDate.toISOString()}))`
+ `${chargingStation.logPrefix()} ${moduleName}.handleResponseStartTransaction: Reserved transaction ${payload.transactionId.toString()} started with expired reservation ${requestPayload.reservationId.toString()} (expiry date: ${reservation.expiryDate.toISOString()}))`
)
}
await chargingStation.removeReservation(
)
} else {
logger.warn(
- `${chargingStation.logPrefix()} Reserved transaction ${payload.transactionId.toString()} started with unknown reservation ${requestPayload.reservationId.toString()}`
+ `${chargingStation.logPrefix()} ${moduleName}.handleResponseStartTransaction: Reserved transaction ${payload.transactionId.toString()} started with unknown reservation ${requestPayload.reservationId.toString()}`
)
}
}
OCPP16ChargePointStatus.Charging
)
logger.info(
- `${chargingStation.logPrefix()} Transaction with id ${payload.transactionId.toString()} STARTED on ${
+ `${chargingStation.logPrefix()} ${moduleName}.handleResponseStartTransaction: Transaction with id ${payload.transactionId.toString()} STARTED on ${
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
chargingStation.stationInfo?.chargingStationId
}#${connectorId.toString()} for idTag '${requestPayload.idTag}'`
)
} else {
logger.warn(
- `${chargingStation.logPrefix()} Starting transaction with id ${payload.transactionId.toString()} REJECTED on ${
+ `${chargingStation.logPrefix()} ${moduleName}.handleResponseStartTransaction: Starting transaction with id ${payload.transactionId.toString()} REJECTED on ${
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
chargingStation.stationInfo?.chargingStationId
}#${connectorId.toString()} with status '${payload.idTagInfo.status}', idTag '${
)
if (transactionConnectorId == null) {
logger.error(
- `${chargingStation.logPrefix()} Trying to stop a non existing transaction with id ${requestPayload.transactionId.toString()}`
+ `${chargingStation.logPrefix()} ${moduleName}.handleResponseStopTransaction: Trying to stop a non existing transaction with id ${requestPayload.transactionId.toString()}`
)
return
}
}
resetConnectorStatus(chargingStation.getConnectorStatus(transactionConnectorId))
chargingStation.stopMeterValues(transactionConnectorId)
- const logMsg = `${chargingStation.logPrefix()} Transaction with id ${requestPayload.transactionId.toString()} STOPPED on ${
+ const logMsg = `${chargingStation.logPrefix()} ${moduleName}.handleResponseStopTransaction: Transaction with id ${requestPayload.transactionId.toString()} STOPPED on ${
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
chargingStation.stationInfo?.chargingStationId
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
import { OCPPServiceUtils } from '../OCPPServiceUtils.js'
import { OCPP16Constants } from './OCPP16Constants.js'
+const moduleName = 'OCPP16ServiceUtils'
+
export class OCPP16ServiceUtils extends OCPPServiceUtils {
public static buildTransactionBeginMeterValue (
chargingStation: ChargingStation,
): boolean {
if (!hasFeatureProfile(chargingStation, featureProfile)) {
logger.warn(
- `${chargingStation.logPrefix()} Trying to '${command}' without '${featureProfile}' feature enabled in ${
+ `${chargingStation.logPrefix()} ${moduleName}.checkFeatureProfile: Trying to '${command}' without '${featureProfile}' feature enabled in ${
OCPP16StandardParametersKey.SupportedFeatureProfiles
} in configuration`
)
if (clearCurrentCP) {
chargingProfiles.splice(index, 1)
logger.debug(
- `${chargingStation.logPrefix()} Matching charging profile(s) cleared: %j`,
+ `${chargingStation.logPrefix()} ${moduleName}.clearChargingProfiles: Matching charging profile(s) cleared: %j`,
chargingProfile
)
clearedCP = true
chargingStationReservation.idTag === idTag)
) {
logger.debug(
- `${chargingStation.logPrefix()} Connector id ${connectorId.toString()} has a valid reservation for idTag ${idTag}: %j`,
+ `${chargingStation.logPrefix()} ${moduleName}.hasReservation: Connector id ${connectorId.toString()} has a valid reservation for idTag ${idTag}: %j`,
connectorReservation ?? chargingStationReservation
)
return true
): void {
if (chargingStation.getConnectorStatus(connectorId)?.chargingProfiles == null) {
logger.error(
- `${chargingStation.logPrefix()} Trying to set a charging profile on connector id ${connectorId.toString()} with an uninitialized charging profiles array attribute, applying deferred initialization`
+ `${chargingStation.logPrefix()} ${moduleName}.setChargingProfile: Trying to set a charging profile on connector id ${connectorId.toString()} with an uninitialized charging profiles array attribute, applying deferred initialization`
)
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
chargingStation.getConnectorStatus(connectorId)!.chargingProfiles = []
}
if (!Array.isArray(chargingStation.getConnectorStatus(connectorId)?.chargingProfiles)) {
logger.error(
- `${chargingStation.logPrefix()} Trying to set a charging profile on connector id ${connectorId.toString()} with an improper attribute type for the charging profiles array, applying proper type deferred initialization`
+ `${chargingStation.logPrefix()} ${moduleName}.setChargingProfile: Trying to set a charging profile on connector id ${connectorId.toString()} with an improper attribute type for the charging profiles array, applying proper type deferred initialization`
)
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
chargingStation.getConnectorStatus(connectorId)!.chargingProfiles = []