X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcharging-station%2FAutomaticTransactionGenerator.ts;h=e32c3c98109f6f520142d1499411b35d12babfcc;hb=e6159ce8b782e3464a9a0dc377897bc4a4718121;hp=fb6e9d28c1f92ee7766104dd4559a79eeb94725e;hpb=083fb002e7ae10bf53cc5890d1e403d556c549f5;p=e-mobility-charging-stations-simulator.git diff --git a/src/charging-station/AutomaticTransactionGenerator.ts b/src/charging-station/AutomaticTransactionGenerator.ts index fb6e9d28..e32c3c98 100644 --- a/src/charging-station/AutomaticTransactionGenerator.ts +++ b/src/charging-station/AutomaticTransactionGenerator.ts @@ -93,7 +93,10 @@ export default class AutomaticTransactionGenerator extends AsyncResource { } if (this.connectorsStatus.get(connectorId)?.start === false) { this.runInAsyncScope( - this.internalStartConnector.bind(this) as (this: this, ...args: any[]) => unknown, + this.internalStartConnector.bind(this) as ( + this: AutomaticTransactionGenerator, + ...args: any[] + ) => void, this, connectorId ); @@ -152,7 +155,7 @@ export default class AutomaticTransactionGenerator extends AsyncResource { this.stopConnector(connectorId); break; } - if (!this.chargingStation.isInAcceptedState()) { + if (this.chargingStation.isInAcceptedState() === false) { logger.error( this.logPrefix(connectorId) + ' entered in transaction loop while the charging station is not in accepted state' @@ -160,7 +163,7 @@ export default class AutomaticTransactionGenerator extends AsyncResource { this.stopConnector(connectorId); break; } - if (!this.chargingStation.isChargingStationAvailable()) { + if (this.chargingStation.isChargingStationAvailable() === false) { logger.info( this.logPrefix(connectorId) + ' entered in transaction loop while the charging station is unavailable' @@ -168,7 +171,7 @@ export default class AutomaticTransactionGenerator extends AsyncResource { this.stopConnector(connectorId); break; } - if (!this.chargingStation.isConnectorAvailable(connectorId)) { + if (this.chargingStation.isConnectorAvailable(connectorId) === false) { logger.info( `${this.logPrefix( connectorId