From: Jérôme Benoit Date: Tue, 21 Mar 2023 21:26:41 +0000 (+0100) Subject: fix: stop the ATG on connector if its status is unavailable X-Git-Tag: v1.2.0-0~36 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=9b4d0c7011a9b8ae65a0ee95193788265acb95ae;p=e-mobility-charging-stations-simulator.git fix: stop the ATG on connector if its status is unavailable Signed-off-by: Jérôme Benoit --- 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(