);
}
- public getReservationOnConnectorId0Enabled(): boolean {
+ public getReserveConnectorZeroSupported(): boolean {
return convertToBoolean(
getConfigurationKey(this, StandardParametersKey.ReserveConnectorZeroSupported)!.value,
);
this.startReservationExpirationSetInterval();
}
- public validateIncomingRequestWithReservation(connectorId: number, idTag: string): boolean {
- return this.getReservationBy('connectorId', connectorId)?.idTag === idTag;
- }
-
public isConnectorReservable(
reservationId: number,
idTag?: string,
chargingStation.getConnectorStatus(0)!.status === OCPP16ChargePointStatus.Reserved;
if (
(reserved &&
- !chargingStation.validateIncomingRequestWithReservation(transactionConnectorId, idTag)) ||
- (reservedOnConnectorZero && !chargingStation.validateIncomingRequestWithReservation(0, idTag))
+ !(
+ chargingStation.getReservationBy('connectorId', transactionConnectorId)?.idTag === idTag
+ )) ||
+ (reservedOnConnectorZero &&
+ !(chargingStation.getReservationBy('connectorId', 0)?.idTag === idTag))
) {
return OCPP16Constants.OCPP_RESPONSE_REJECTED;
}
if (!chargingStation.isConnectorAvailable(connectorId) && connectorId > 0) {
return OCPP16Constants.OCPP_RESERVATION_RESPONSE_REJECTED;
}
- if (connectorId === 0 && !chargingStation.getReservationOnConnectorId0Enabled()) {
+ if (connectorId === 0 && !chargingStation.getReserveConnectorZeroSupported()) {
return OCPP16Constants.OCPP_RESERVATION_RESPONSE_REJECTED;
}
if (!(await OCPP16ServiceUtils.isIdTagAuthorized(chargingStation, connectorId, idTag))) {