connectorId: number,
status: ConnectorStatusEnum
): StatusNotificationRequest {
- switch (chargingStation.stationInfo.ocppVersion) {
+ switch (chargingStation.stationInfo.ocppVersion ?? OCPPVersion.VERSION_16) {
case OCPPVersion.VERSION_16:
return {
connectorId,
connectorId,
evseId: connectorId,
} as OCPP20StatusNotificationRequest;
+ default:
+ throw new BaseError('Cannot build status notification payload: OCPP version not supported');
}
}