From: Jérôme Benoit Date: Thu, 6 Jun 2024 18:33:22 +0000 (+0200) Subject: refactor: cleanup boot notification response handling X-Git-Tag: v1.3.4~5 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=52f1dd569da1eac66de821796cdfbcef09b48c87;p=e-mobility-charging-stations-simulator.git refactor: cleanup boot notification response handling Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/ChargingStation.ts b/src/charging-station/ChargingStation.ts index e8d6387f..20223052 100644 --- a/src/charging-station/ChargingStation.ts +++ b/src/charging-station/ChargingStation.ts @@ -1843,13 +1843,10 @@ export class ChargingStation extends EventEmitter { >(this, RequestCommand.BOOT_NOTIFICATION, this.bootNotificationRequest, { skipBufferingOnError: true }) - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition - if (this.bootNotificationResponse?.currentTime != null) { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - this.bootNotificationResponse.currentTime = convertToDate( - this.bootNotificationResponse.currentTime - )! - } + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + this.bootNotificationResponse!.currentTime = convertToDate( + this.bootNotificationResponse?.currentTime + )! if (!this.isRegistered()) { this.stationInfo?.registrationMaxRetries !== -1 && ++registrationRetryCount await sleep(