From 9b4d0c7011a9b8ae65a0ee95193788265acb95ae Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Tue, 21 Mar 2023 22:26:41 +0100 Subject: [PATCH] fix: stop the ATG on connector if its status is unavailable MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- .../AutomaticTransactionGenerator.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/charging-station/AutomaticTransactionGenerator.ts b/src/charging-station/AutomaticTransactionGenerator.ts index 4185215a..3fef7d87 100644 --- a/src/charging-station/AutomaticTransactionGenerator.ts +++ b/src/charging-station/AutomaticTransactionGenerator.ts @@ -11,6 +11,7 @@ import { type AuthorizeRequest, type AuthorizeResponse, type AutomaticTransactionGeneratorConfiguration, + ConnectorStatusEnum, IdTagDistribution, RequestCommand, type StartTransactionRequest, @@ -184,6 +185,18 @@ export class AutomaticTransactionGenerator extends AsyncResource { this.stopConnector(connectorId); break; } + if ( + this.chargingStation.getConnectorStatus(connectorId)?.status === + ConnectorStatusEnum.Unavailable + ) { + logger.info( + `${this.logPrefix( + connectorId + )} entered in transaction loop while the connector ${connectorId} status is unavailable` + ); + this.stopConnector(connectorId); + break; + } if (!this.chargingStation?.ocppRequestService) { logger.info( `${this.logPrefix( -- 2.34.1