From a275c0b6658b4b121643f4c15166b7f2bb409080 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Mon, 8 Apr 2024 23:14:29 +0200 Subject: [PATCH] fix: reset 'Reserved' connector status if transaction is rejected MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit reference: https://github.com/SAP/e-mobility-charging-stations-simulator/pull/1031 Signed-off-by: Jérôme Benoit --- src/charging-station/ocpp/1.6/OCPP16ResponseService.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/charging-station/ocpp/1.6/OCPP16ResponseService.ts b/src/charging-station/ocpp/1.6/OCPP16ResponseService.ts index 0fa38728..24108ba4 100644 --- a/src/charging-station/ocpp/1.6/OCPP16ResponseService.ts +++ b/src/charging-station/ocpp/1.6/OCPP16ResponseService.ts @@ -819,7 +819,13 @@ export class OCPP16ResponseService extends OCPPResponseService { const connectorStatus = chargingStation.getConnectorStatus(connectorId) resetConnectorStatus(connectorStatus) chargingStation.stopMeterValues(connectorId) - if (connectorStatus?.status !== OCPP16ChargePointStatus.Available) { + if (chargingStation.getReservationBy('connectorId', connectorId) != null) { + await OCPP16ServiceUtils.sendAndSetConnectorStatus( + chargingStation, + connectorId, + OCPP16ChargePointStatus.Reserved + ) + } else if (connectorStatus?.status !== OCPP16ChargePointStatus.Available) { await OCPP16ServiceUtils.sendAndSetConnectorStatus( chargingStation, connectorId, -- 2.34.1