X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcharging-station%2FChargingStation.ts;h=1699f046da3982353a45ec637d43adce4b91d6d8;hb=c2d3028f2593d516d2a4e0c8d2bb646f6052a392;hp=959b6c2c506d471829c3e018bca5deb4f9c714ef;hpb=c7e8e0a2239500b34af95e2e46f6993470ea2f02;p=e-mobility-charging-stations-simulator.git diff --git a/src/charging-station/ChargingStation.ts b/src/charging-station/ChargingStation.ts index 959b6c2c..1699f046 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); } @@ -1308,7 +1315,7 @@ export default class ChargingStation { private getOcppConfigurationFromFile(): ChargingStationOcppConfiguration | null { let configuration: ChargingStationConfiguration = null; - if (this.getOcppPersistentConfiguration()) { + if (this.getOcppPersistentConfiguration() === true) { const configurationFromFile = this.getConfigurationFromFile(); configuration = configurationFromFile?.configurationKey && configurationFromFile; } @@ -1354,7 +1361,7 @@ export default class ChargingStation { ); } if (this.isRegistered() === true) { - if (this.isInAcceptedState()) { + if (this.isInAcceptedState() === true) { await this.startMessageSequence(); } } else { @@ -1843,9 +1850,7 @@ export default class ChargingStation { if (webSocketPingInterval > 0 && !this.webSocketPingSetInterval) { this.webSocketPingSetInterval = setInterval(() => { if (this.isWebSocketConnectionOpened() === true) { - this.wsConnection.ping((): void => { - /* This is intentional */ - }); + this.wsConnection.ping(); } }, webSocketPingInterval * 1000); logger.info(