From f5b510718648489542bbbd21c3581c45db8b669b Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Mon, 3 Oct 2022 21:11:46 +0200 Subject: [PATCH] Initialize connectors status only if not defined MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/charging-station/ChargingStation.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/charging-station/ChargingStation.ts b/src/charging-station/ChargingStation.ts index 77a49cbb..85a62c58 100644 --- a/src/charging-station/ChargingStation.ts +++ b/src/charging-station/ChargingStation.ts @@ -1199,10 +1199,17 @@ export default class ChargingStation { } // Initialize transaction attributes on connectors for (const connectorId of this.connectors.keys()) { + if (connectorId > 0 && this.getConnectorStatus(connectorId).transactionStarted === true) { + logger.warn( + `${this.logPrefix()} Connector ${connectorId} at initialization has a transaction started: ${ + this.getConnectorStatus(connectorId).transactionId + }` + ); + } if ( connectorId > 0 && (this.getConnectorStatus(connectorId).transactionStarted === undefined || - this.getConnectorStatus(connectorId).transactionStarted === false) + this.getConnectorStatus(connectorId).transactionStarted === null) ) { this.initializeConnectorStatus(connectorId); } -- 2.34.1