type ChargingStationConfiguration,
type ChargingStationInfo,
type ChargingStationTemplate,
+ type ConnectorStatus,
ConnectorStatusEnum,
+ type EvseStatus,
OCPP20OptionalVariableName,
OCPPVersion,
RegistrationStatusEnumType,
status: RegistrationStatusEnumType.ACCEPTED,
} as BootNotificationResponse,
connectors,
- emitChargingStationEvent: () => {
+ emitChargingStationEvent: (): void => {
/* no-op for tests */
},
evses,
- getConnectionTimeout: () => connectionTimeout,
- getConnectorIdByTransactionId: (transactionId: number | string | undefined) => {
+ getConnectionTimeout: (): number => connectionTimeout,
+ getConnectorIdByTransactionId: (
+ transactionId: number | string | undefined
+ ): number | undefined => {
if (transactionId == null) {
return undefined
}
}
return undefined
},
- getConnectorStatus: (connectorId: number) => {
+ getConnectorStatus: (connectorId: number): ConnectorStatus | undefined => {
if (chargingStation.hasEvses) {
for (const evseStatus of chargingStation.evses.values()) {
if (evseStatus.connectors.has(connectorId)) {
}
return chargingStation.connectors.get(connectorId)
},
- getEvseIdByConnectorId: (connectorId: number) => {
+ getEvseIdByConnectorId: (connectorId: number): number | undefined => {
if (!chargingStation.hasEvses) {
return undefined
}
}
return undefined
},
- getEvseIdByTransactionId: (transactionId: number | string | undefined) => {
+ getEvseIdByTransactionId: (transactionId: number | string | undefined): number | undefined => {
if (transactionId == null) {
return undefined
}
}
return undefined
},
- getHeartbeatInterval: () => heartbeatInterval,
+ getEvseStatus: (evseId: number): EvseStatus | undefined => {
+ return chargingStation.evses.get(evseId)
+ },
+ getHeartbeatInterval: (): number => heartbeatInterval,
getLocalAuthListEnabled: (): boolean => {
const localAuthListEnabled = getConfigurationKey(
chargingStation,
return localAuthListEnabled != null ? convertToBoolean(localAuthListEnabled.value) : false
},
getNumberOfEvses: (): number => evses.size,
- getWebSocketPingInterval: () => websocketPingInterval,
+ getWebSocketPingInterval: (): number => websocketPingInterval,
hasEvses: useEvses,
hasIdTags: (): boolean => false,
idTagsCache: IdTagsCache.getInstance(),
isChargingStationAvailable: (): boolean => {
return chargingStation.getConnectorStatus(0)?.availability === AvailabilityType.Operative
},
- isConnectorAvailable: (connectorId: number) => {
+ isConnectorAvailable: (connectorId: number): boolean => {
return (
connectorId > 0 &&
chargingStation.getConnectorStatus(connectorId)?.availability === AvailabilityType.Operative
)
)
},
- stop: () => {
+ stop: (): void => {
throw new Error(
'ocppIncomingRequestService.stop not mocked. Define in createChargingStation options.'
)
)
},
},
- restartHeartbeat: () => {
+ restartHeartbeat: (): void => {
/* no-op for tests */
},
- restartWebSocketPing: () => {
+ restartWebSocketPing: (): void => {
/* no-op for tests */
},
- saveOcppConfiguration: () => {
+ saveOcppConfiguration: (): void => {
/* no-op for tests */
},
started: options.started ?? false,