this.wsConnectionRetried
? true
: this.getAutomaticTransactionGeneratorConfiguration()?.stopAbsoluteDuration
- ).catch(error => {
+ ).catch((error: unknown) => {
logger.error(`${this.logPrefix()} Error while starting the message sequence:`, error)
})
this.wsConnectionRetried = false
readFileSync(this.templateFile, 'utf8')
) as ChargingStationTemplate
} catch {
- stationTemplate = undefined
+ // Ignore
}
return logPrefix(` ${getChargingStationId(this.index, stationTemplate)} |`)
}
this.heartbeatSetInterval = setInterval(() => {
this.ocppRequestService
.requestHandler<HeartbeatRequest, HeartbeatResponse>(this, RequestCommand.HEARTBEAT)
- .catch(error => {
+ .catch((error: unknown) => {
logger.error(
`${this.logPrefix()} Error while sending '${RequestCommand.HEARTBEAT}':`,
error
meterValue: [meterValue]
}
)
- .catch(error => {
+ .catch((error: unknown) => {
logger.error(
`${this.logPrefix()} Error while sending '${RequestCommand.METER_VALUES}':`,
error
this.wsConnection.on('close', this.onClose.bind(this))
// Handle WebSocket open
this.wsConnection.on('open', () => {
- this.onOpen().catch(error =>
+ this.onOpen().catch((error: unknown) =>
logger.error(`${this.logPrefix()} Error while opening WebSocket connection:`, error)
)
})
} does not match firmware version pattern '${stationInfo.firmwareVersionPattern}'`
)
}
- stationInfo.firmwareUpgrade = mergeDeepRight(
- {
- versionUpgrade: {
- step: 1
- },
- reset: true
- },
- stationTemplate.firmwareUpgrade ?? {}
- )
if (stationTemplate.resetTime != null) {
stationInfo.resetTime = secondsToMilliseconds(stationTemplate.resetTime)
}
const stationInfoFromFile = this.getStationInfoFromFile(
stationInfoFromTemplate.stationInfoPersistentConfiguration
)
+ let stationInfo: ChargingStationInfo
// Priority:
// 1. charging station info from template
// 2. charging station info from configuration file
stationInfoFromFile != null &&
stationInfoFromFile.templateHash === stationInfoFromTemplate.templateHash
) {
- return setChargingStationOptions(
- { ...Constants.DEFAULT_STATION_INFO, ...stationInfoFromFile },
- options
- )
+ stationInfo = stationInfoFromFile
+ } else {
+ stationInfo = stationInfoFromTemplate
+ stationInfoFromFile != null &&
+ propagateSerialNumber(this.getTemplateFromFile(), stationInfoFromFile, stationInfo)
}
- stationInfoFromFile != null &&
- propagateSerialNumber(
- this.getTemplateFromFile(),
- stationInfoFromFile,
- stationInfoFromTemplate
- )
return setChargingStationOptions(
- { ...Constants.DEFAULT_STATION_INFO, ...stationInfoFromTemplate },
+ mergeDeepRight(Constants.DEFAULT_STATION_INFO, stationInfo),
options
)
}
this.sharedLRUCache.deleteChargingStationConfiguration(this.configurationFileHash)
this.sharedLRUCache.setChargingStationConfiguration(configurationData)
this.configurationFileHash = configurationHash
- }).catch(error => {
+ }).catch((error: unknown) => {
handleFileException(
this.configurationFile,
FileType.ChargingStationConfiguration,
.then(() => {
this.emit(ChargingStationEvents.updated)
})
- .catch(error => logger.error(`${this.logPrefix()} Error while reconnecting:`, error))
+ .catch((error: unknown) =>
+ logger.error(`${this.logPrefix()} Error while reconnecting:`, error)
+ )
break
}
}
for (const [evseId, evseStatus] of this.evses) {
if (evseId > 0) {
for (const [connectorId, connectorStatus] of evseStatus.connectors) {
- const connectorBootStatus = getBootConnectorStatus(this, connectorId, connectorStatus)
- await sendAndSetConnectorStatus(this, connectorId, connectorBootStatus, evseId)
+ await sendAndSetConnectorStatus(
+ this,
+ connectorId,
+ getBootConnectorStatus(this, connectorId, connectorStatus),
+ evseId
+ )
}
}
}
} else {
for (const connectorId of this.connectors.keys()) {
if (connectorId > 0) {
- const connectorBootStatus = getBootConnectorStatus(
+ await sendAndSetConnectorStatus(
this,
connectorId,
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
- this.getConnectorStatus(connectorId)!
+ getBootConnectorStatus(
+ this,
+ connectorId,
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
+ this.getConnectorStatus(connectorId)!
+ )
)
- await sendAndSetConnectorStatus(this, connectorId, connectorBootStatus)
}
}
}