From: Jérôme Benoit Date: Mon, 3 Oct 2022 19:11:46 +0000 (+0200) Subject: Initialize connectors status only if not defined X-Git-Tag: v1.1.76~16 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=f5b510718648489542bbbd21c3581c45db8b669b;p=e-mobility-charging-stations-simulator.git Initialize connectors status only if not defined Signed-off-by: Jérôme Benoit --- 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); }