)
)
logger.info(
- `${this.logPrefix(connectorId)} transaction started with id ${// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
- this.chargingStation
+ // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
+ `${this.logPrefix(connectorId)} transaction started with id ${this.chargingStation
.getConnectorStatus(connectorId)
?.transactionId?.toString()} and will stop in ${formatDurationMilliSeconds(waitTrxEnd)}`
)
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
++this.connectorsStatus.get(connectorId)!.skippedTransactions
logger.info(
- `${this.logPrefix(connectorId)} skipped consecutively ${// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
- this.connectorsStatus
+ // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
+ `${this.logPrefix(connectorId)} skipped consecutively ${this.connectorsStatus
.get(connectorId)
?.skippedConsecutiveTransactions.toString()
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
const connectorStatus = this.chargingStation.getConnectorStatus(connectorId)
if (connectorStatus?.transactionStarted === true) {
logger.info(
- `${this.logPrefix(connectorId)} entered in transaction loop while a transaction ${// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
- connectorStatus.transactionId?.toString()} is already started on connector ${connectorId.toString()}`
+ // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
+ `${this.logPrefix(connectorId)} entered in transaction loop while a transaction ${connectorStatus.transactionId?.toString()} is already started on connector ${connectorId.toString()}`
)
return false
}
while (connectorStatus?.transactionStarted === true) {
if (!logged) {
logger.info(
- `${this.logPrefix(connectorId)} transaction loop waiting for started transaction ${// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
- connectorStatus.transactionId?.toString()} on connector ${connectorId.toString()} to be stopped`
+ // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
+ `${this.logPrefix(connectorId)} transaction loop waiting for started transaction ${connectorStatus.transactionId?.toString()} on connector ${connectorId.toString()} to be stopped`
)
logged = true
}
let stopResponse: StopTransactionResponse | undefined
if (this.chargingStation.getConnectorStatus(connectorId)?.transactionStarted === true) {
logger.info(
- `${this.logPrefix(connectorId)} stop transaction with id ${// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
- this.chargingStation.getConnectorStatus(connectorId)?.transactionId?.toString()}`
+ // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
+ `${this.logPrefix(connectorId)} stop transaction with id ${this.chargingStation
+ .getConnectorStatus(connectorId)
+ ?.transactionId?.toString()}`
)
stopResponse = await this.chargingStation.stopTransactionOnConnector(connectorId, reason)
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
}
if (!this.isRegistered()) {
logger.error(
- `${this.logPrefix()} Registration failure: maximum retries reached (${registrationRetryCount.toString()}) or retry disabled (${// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
- this.stationInfo?.registrationMaxRetries?.toString()})`
+ // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
+ `${this.logPrefix()} Registration failure: maximum retries reached (${registrationRetryCount.toString()}) or retry disabled (${this.stationInfo?.registrationMaxRetries?.toString()})`
)
}
this.emit(ChargingStationEvents.updated)
for (const connectorId of connectors.keys()) {
if (connectorId > 0 && connectors.get(connectorId)?.transactionStarted === true) {
logger.warn(
- `${logPrefix} Connector id ${connectorId.toString()} at initialization has a transaction started with id ${// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
- connectors.get(connectorId)?.transactionId?.toString()}`
+ // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
+ `${logPrefix} Connector id ${connectorId.toString()} at initialization has a transaction started with id ${connectors
+ .get(connectorId)
+ ?.transactionId?.toString()}`
)
}
if (connectorId === 0) {
status: DataTransferStatus.UNKNOWN_VENDOR_ID,
})
+ // Reservation has been made
static readonly OCPP_RESERVATION_RESPONSE_ACCEPTED = Object.freeze({
status: ReservationStatus.ACCEPTED,
- }) // Reservation has been made
+ })
+ // Reservation has not been made, because of connector in FAULTED state
static readonly OCPP_RESERVATION_RESPONSE_FAULTED = Object.freeze({
status: ReservationStatus.FAULTED,
- }) // Reservation has not been made, because of connector in FAULTED state
+ })
+ // Reservation has not been made, because all connectors are OCCUPIED
static readonly OCPP_RESERVATION_RESPONSE_OCCUPIED = Object.freeze({
status: ReservationStatus.OCCUPIED,
- }) // Reservation has not been made, because all connectors are OCCUPIED
+ })
+ // Reservation has not been made, because charging station is not configured to accept reservations
static readonly OCPP_RESERVATION_RESPONSE_REJECTED = Object.freeze({
status: ReservationStatus.REJECTED,
- }) // Reservation has not been made, because charging station is not configured to accept reservations
+ })
+ // Reservation has not been made, because connector is in UNAVAILABLE state
static readonly OCPP_RESERVATION_RESPONSE_UNAVAILABLE = Object.freeze({
status: ReservationStatus.UNAVAILABLE,
- }) // Reservation has not been made, because connector is in UNAVAILABLE state
+ })
+ // Reservation for id has been cancelled
static readonly OCPP_CANCEL_RESERVATION_RESPONSE_ACCEPTED = Object.freeze({
status: GenericStatus.Accepted,
- }) // Reservation for id has been cancelled
+ })
+ // Reservation could not be cancelled, because there is no reservation active for id
static readonly OCPP_CANCEL_RESERVATION_RESPONSE_REJECTED = Object.freeze({
status: GenericStatus.Rejected,
- }) // Reservation could not be cancelled, because there is no reservation active for id
+ })
protected constructor () {
// This is intentional
`${chargingStation.logPrefix()} MeterValues measurand ${
meterValue.sampledValue[sampledValuesIndex].measurand ??
MeterValueMeasurand.ENERGY_ACTIVE_IMPORT_REGISTER
- }: connector id ${connectorId.toString()}, transaction id ${// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
- connector?.transactionId?.toString()}, value: ${socMinimumValue.toString()}/${
+ // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
+ }: connector id ${connectorId.toString()}, transaction id ${connector?.transactionId?.toString()}, value: ${socMinimumValue.toString()}/${
meterValue.sampledValue[sampledValuesIndex].value
}/${socMaximumValue.toString()}`
)
`${chargingStation.logPrefix()} MeterValues measurand ${
meterValue.sampledValue[sampledValuesIndex].measurand ??
MeterValueMeasurand.ENERGY_ACTIVE_IMPORT_REGISTER
- }: connector id ${connectorId.toString()}, transaction id ${// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
- connector?.transactionId?.toString()}, value: ${connectorMinimumPowerRounded.toString()}/${
+ // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
+ }: connector id ${connectorId.toString()}, transaction id ${connector?.transactionId?.toString()}, value: ${connectorMinimumPowerRounded.toString()}/${
meterValue.sampledValue[sampledValuesIndex].value
}/${connectorMaximumPowerRounded.toString()}`
)
}: phase ${
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
meterValue.sampledValue[sampledValuesPerPhaseIndex].phase
- }, connector id ${connectorId.toString()}, transaction id ${// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
- connector?.transactionId?.toString()}, value: ${connectorMinimumPowerPerPhaseRounded.toString()}/${
+ // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
+ }, connector id ${connectorId.toString()}, transaction id ${connector?.transactionId?.toString()}, value: ${connectorMinimumPowerPerPhaseRounded.toString()}/${
meterValue.sampledValue[sampledValuesPerPhaseIndex].value
}/${connectorMaximumPowerPerPhaseRounded.toString()}`
)
`${chargingStation.logPrefix()} MeterValues measurand ${
meterValue.sampledValue[sampledValuesIndex].measurand ??
MeterValueMeasurand.ENERGY_ACTIVE_IMPORT_REGISTER
- }: connector id ${connectorId.toString()}, transaction id ${// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
- connector?.transactionId?.toString()}, value: ${connectorMinimumAmperage.toString()}/${
+ // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
+ }: connector id ${connectorId.toString()}, transaction id ${connector?.transactionId?.toString()}, value: ${connectorMinimumAmperage.toString()}/${
meterValue.sampledValue[sampledValuesIndex].value
}/${connectorMaximumAmperage.toString()}`
)
}: phase ${
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
meterValue.sampledValue[sampledValuesPerPhaseIndex].phase
- }, connector id ${connectorId.toString()}, transaction id ${// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
+ }, connector id ${connectorId.toString()}, transaction id $
connector?.transactionId?.toString()}, value: ${connectorMinimumAmperage.toString()}/${
meterValue.sampledValue[sampledValuesPerPhaseIndex].value
}/${connectorMaximumAmperage.toString()}`
`${chargingStation.logPrefix()} MeterValues measurand ${
meterValue.sampledValue[sampledValuesIndex].measurand ??
MeterValueMeasurand.ENERGY_ACTIVE_IMPORT_REGISTER
- }: connector id ${connectorId.toString()}, transaction id ${// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
- connector?.transactionId?.toString()}, value: ${connectorMinimumEnergyRounded.toString()}/${energyValueRounded.toString()}/${connectorMaximumEnergyRounded.toString()}, duration: ${interval.toString()}ms`
+ // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
+ }: connector id ${connectorId.toString()}, transaction id ${connector?.transactionId?.toString()}, value: ${connectorMinimumEnergyRounded.toString()}/${energyValueRounded.toString()}/${connectorMaximumEnergyRounded.toString()}, duration: ${interval.toString()}ms`
)
}
}