getMaxNumberOfEvses,
getNumberOfReservableConnectors,
getPhaseRotationValue,
+ hasFeatureProfile,
hasReservationExpired,
initializeConnectorsMapStatus,
propagateSerialNumber,
this,
StandardParametersKey.AuthorizeRemoteTxRequests
)
- return authorizeRemoteTxRequests !== undefined
+ return authorizeRemoteTxRequests != null
? convertToBoolean(authorizeRemoteTxRequests.value)
: false
}
this,
StandardParametersKey.LocalAuthListEnabled
)
- return localAuthListEnabled !== undefined ? convertToBoolean(localAuthListEnabled.value) : false
+ return localAuthListEnabled != null ? convertToBoolean(localAuthListEnabled.value) : false
}
public getHeartbeatInterval (): number {
const HeartbeatInterval = getConfigurationKey(this, StandardParametersKey.HeartbeatInterval)
- if (HeartbeatInterval !== undefined) {
+ if (HeartbeatInterval != null) {
return secondsToMilliseconds(convertToInt(HeartbeatInterval.value))
}
const HeartBeatInterval = getConfigurationKey(this, StandardParametersKey.HeartBeatInterval)
- if (HeartBeatInterval !== undefined) {
+ if (HeartBeatInterval != null) {
return secondsToMilliseconds(convertToInt(HeartBeatInterval.value))
}
this.stationInfo?.autoRegister === false &&
}
public startHeartbeat (): void {
- if (this.getHeartbeatInterval() > 0 && this.heartbeatSetInterval === undefined) {
+ if (this.getHeartbeatInterval() > 0 && this.heartbeatSetInterval == null) {
this.heartbeatSetInterval = setInterval(() => {
this.ocppRequestService
.requestHandler<HeartbeatRequest, HeartbeatResponse>(this, RequestCommand.HEARTBEAT)
this.getHeartbeatInterval()
)}`
)
- } else if (this.heartbeatSetInterval !== undefined) {
+ } else if (this.heartbeatSetInterval != null) {
logger.info(
`${this.logPrefix()} Heartbeat already started every ${formatDurationMilliSeconds(
this.getHeartbeatInterval()
}
public stopMeterValues (connectorId: number): void {
- if (this.getConnectorStatus(connectorId)?.transactionSetInterval !== undefined) {
+ if (this.getConnectorStatus(connectorId)?.transactionSetInterval != null) {
clearInterval(this.getConnectorStatus(connectorId)?.transactionSetInterval)
}
}
public async addReservation (reservation: Reservation): Promise<void> {
const reservationFound = this.getReservationBy('reservationId', reservation.reservationId)
- if (reservationFound !== undefined) {
+ if (reservationFound != null) {
await this.removeReservation(reservationFound, ReservationTerminationReason.REPLACE_EXISTING)
}
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
}
private setIntervalFlushMessageBuffer (): void {
- if (this.flushMessageBufferSetInterval === undefined) {
+ if (this.flushMessageBufferSetInterval == null) {
this.flushMessageBufferSetInterval = setInterval(() => {
if (this.isWebSocketConnectionOpened() && this.inAcceptedState()) {
this.flushMessageBuffer()
}
private clearIntervalFlushMessageBuffer (): void {
- if (this.flushMessageBufferSetInterval !== undefined) {
+ if (this.flushMessageBufferSetInterval != null) {
clearInterval(this.flushMessageBufferSetInterval)
delete this.flushMessageBufferSetInterval
}
}
if (
isNullOrUndefined(getConfigurationKey(this, StandardParametersKey.LocalAuthListEnabled)) &&
- getConfigurationKey(this, StandardParametersKey.SupportedFeatureProfiles)?.value?.includes(
- SupportedFeatureProfiles.LocalAuthListManagement
- ) === true
+ hasFeatureProfile(this, SupportedFeatureProfiles.LocalAuthListManagement) === true
) {
addConfigurationKey(this, StandardParametersKey.LocalAuthListEnabled, 'false')
}
// 0 for disabling
private getConnectionTimeout (): number {
- if (getConfigurationKey(this, StandardParametersKey.ConnectionTimeOut) !== undefined) {
+ if (getConfigurationKey(this, StandardParametersKey.ConnectionTimeOut) != null) {
return convertToInt(
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
getConfigurationKey(this, StandardParametersKey.ConnectionTimeOut)!.value! ??
if (
isNotEmptyString(this.stationInfo?.amperageLimitationOcppKey) &&
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
- getConfigurationKey(this, this.stationInfo.amperageLimitationOcppKey!) !== undefined
+ getConfigurationKey(this, this.stationInfo.amperageLimitationOcppKey!) != null
) {
return (
convertToInt(
private startWebSocketPing (): void {
const webSocketPingInterval: number =
- getConfigurationKey(this, StandardParametersKey.WebSocketPingInterval) !== undefined
+ getConfigurationKey(this, StandardParametersKey.WebSocketPingInterval) != null
? convertToInt(
getConfigurationKey(this, StandardParametersKey.WebSocketPingInterval)?.value
)
: 0
- if (webSocketPingInterval > 0 && this.webSocketPingSetInterval === undefined) {
+ if (webSocketPingInterval > 0 && this.webSocketPingSetInterval == null) {
this.webSocketPingSetInterval = setInterval(() => {
if (this.isWebSocketConnectionOpened()) {
this.wsConnection?.ping()
webSocketPingInterval
)}`
)
- } else if (this.webSocketPingSetInterval !== undefined) {
+ } else if (this.webSocketPingSetInterval != null) {
logger.info(
`${this.logPrefix()} WebSocket ping already started every ${formatDurationSeconds(
webSocketPingInterval
}
private stopWebSocketPing (): void {
- if (this.webSocketPingSetInterval !== undefined) {
+ if (this.webSocketPingSetInterval != null) {
clearInterval(this.webSocketPingSetInterval)
delete this.webSocketPingSetInterval
}
}
private stopHeartbeat (): void {
- if (this.heartbeatSetInterval !== undefined) {
+ if (this.heartbeatSetInterval != null) {
clearInterval(this.heartbeatSetInterval)
delete this.heartbeatSetInterval
}