From: Jérôme Benoit Date: Fri, 7 Jun 2024 21:00:49 +0000 (+0200) Subject: fix: ensure ATG status is refreshed in the UI at stop X-Git-Tag: v1.3.5~9 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=c004d5e2e7d277ab99b3ee1b8ce363736529db9e;p=e-mobility-charging-stations-simulator.git fix: ensure ATG status is refreshed in the UI at stop Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/AutomaticTransactionGenerator.ts b/src/charging-station/AutomaticTransactionGenerator.ts index 0eb47381..9f1c4d39 100644 --- a/src/charging-station/AutomaticTransactionGenerator.ts +++ b/src/charging-station/AutomaticTransactionGenerator.ts @@ -8,6 +8,7 @@ import { BaseError } from '../exception/index.js' import { PerformanceStatistics } from '../performance/index.js' import { AuthorizationStatus, + ChargingStationEvents, RequestCommand, type StartTransactionRequest, type StartTransactionResponse, @@ -262,9 +263,10 @@ export class AutomaticTransactionGenerator { )}` ) logger.debug( - `${this.logPrefix(connectorId)} connector status: %j`, + `${this.logPrefix(connectorId)} stopped with connector status: %j`, this.connectorsStatus.get(connectorId) ) + this.chargingStation.emit(ChargingStationEvents.updated) } private setStartConnectorStatus ( @@ -294,6 +296,7 @@ export class AutomaticTransactionGenerator { this.connectorsStatus.get(connectorId)!.skippedConsecutiveTransactions = 0 // eslint-disable-next-line @typescript-eslint/no-non-null-assertion this.connectorsStatus.get(connectorId)!.start = true + this.chargingStation.emit(ChargingStationEvents.updated) } private canStartConnector (connectorId: number): boolean {