From: Jérôme Benoit Date: Sun, 30 Jul 2023 17:01:03 +0000 (+0200) Subject: refactor: cleanup reservation check condition X-Git-Tag: v1.2.20~77 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=0557254bd178be09468f48b28c570efa4ada83b2;p=e-mobility-charging-stations-simulator.git refactor: cleanup reservation check condition Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts b/src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts index 87277e88..cc16622a 100644 --- a/src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts +++ b/src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts @@ -833,11 +833,9 @@ export class OCPP16IncomingRequestService extends OCPPIncomingRequestService { chargingStation.getConnectorStatus(0)!.status === OCPP16ChargePointStatus.Reserved; if ( (reserved && - !( - chargingStation.getReservationBy('connectorId', transactionConnectorId)?.idTag === idTag - )) || + chargingStation.getReservationBy('connectorId', transactionConnectorId)?.idTag !== idTag) || (reservedOnConnectorZero && - !(chargingStation.getReservationBy('connectorId', 0)?.idTag === idTag)) + chargingStation.getReservationBy('connectorId', 0)?.idTag !== idTag) ) { return OCPP16Constants.OCPP_RESPONSE_REJECTED; }