- get timeToStop(): boolean {
- return this._timeToStop;
- }
-
- _logPrefix(connectorId: number = null): string {
- if (connectorId) {
- return Utils.logPrefix(' ' + this._chargingStation.stationInfo.name + ' ATG on connector #' + connectorId.toString() + ':');
- }
- return Utils.logPrefix(' ' + this._chargingStation.stationInfo.name + ' ATG:');
- }
-
- start(): void {
- this._timeToStop = false;
- if (this._chargingStation.stationInfo.AutomaticTransactionGenerator.stopAfterHours &&
- this._chargingStation.stationInfo.AutomaticTransactionGenerator.stopAfterHours > 0) {
- setTimeout(() => {
- void this.stop();
- }, this._chargingStation.stationInfo.AutomaticTransactionGenerator.stopAfterHours * 3600 * 1000);
+ public async start(): Promise<void> {
+ this.timeToStop = false;
+ if (this.chargingStation.stationInfo.AutomaticTransactionGenerator.stopAfterHours &&
+ this.chargingStation.stationInfo.AutomaticTransactionGenerator.stopAfterHours > 0) {
+ // eslint-disable-next-line @typescript-eslint/no-misused-promises
+ setTimeout(async (): Promise<void> => {
+ await this.stop();
+ }, this.chargingStation.stationInfo.AutomaticTransactionGenerator.stopAfterHours * 3600 * 1000);