From: Jérôme Benoit Date: Sun, 2 Oct 2022 17:45:10 +0000 (+0200) Subject: More strict boolean checks X-Git-Tag: v1.1.75~8 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=b7f9e41d245e224e1a1a47010803960766dbec61;p=e-mobility-charging-stations-simulator.git More strict boolean checks Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/ChargingStation.ts b/src/charging-station/ChargingStation.ts index 7853d10e..7078641b 100644 --- a/src/charging-station/ChargingStation.ts +++ b/src/charging-station/ChargingStation.ts @@ -953,7 +953,7 @@ export default class ChargingStation { this.handleUnsupportedVersion(this.getOcppVersion()); break; } - if (this.stationInfo?.autoRegister) { + if (this.stationInfo?.autoRegister === true) { this.bootNotificationResponse = { currentTime: new Date().toISOString(), interval: this.getHeartbeatInterval() / 1000, @@ -1745,7 +1745,7 @@ export default class ChargingStation { } private async startMessageSequence(): Promise { - if (this.stationInfo?.autoRegister) { + if (this.stationInfo?.autoRegister === true) { await this.ocppRequestService.requestHandler< BootNotificationRequest, BootNotificationResponse @@ -1923,7 +1923,7 @@ export default class ChargingStation { if (HeartBeatInterval) { return Utils.convertToInt(HeartBeatInterval.value) * 1000; } - !this.stationInfo?.autoRegister && + this.stationInfo?.autoRegister === false && logger.warn( `${this.logPrefix()} Heartbeat interval configuration key not set, using default value: ${ Constants.DEFAULT_HEARTBEAT_INTERVAL