From 2329015067d5715c3eb0b56984a66cdc1fe31452 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Wed, 19 Oct 2022 11:02:20 +0200 Subject: [PATCH] Strict boolean checks MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/charging-station/ChargingStation.ts | 4 ++-- src/charging-station/ocpp/OCPPServiceUtils.ts | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/charging-station/ChargingStation.ts b/src/charging-station/ChargingStation.ts index 85a62c58..1699f046 100644 --- a/src/charging-station/ChargingStation.ts +++ b/src/charging-station/ChargingStation.ts @@ -1315,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; } @@ -1361,7 +1361,7 @@ export default class ChargingStation { ); } if (this.isRegistered() === true) { - if (this.isInAcceptedState()) { + if (this.isInAcceptedState() === true) { await this.startMessageSequence(); } } else { diff --git a/src/charging-station/ocpp/OCPPServiceUtils.ts b/src/charging-station/ocpp/OCPPServiceUtils.ts index 163828d5..ad78d347 100644 --- a/src/charging-station/ocpp/OCPPServiceUtils.ts +++ b/src/charging-station/ocpp/OCPPServiceUtils.ts @@ -88,10 +88,10 @@ export class OCPPServiceUtils { } if ( measurand !== MeterValueMeasurand.ENERGY_ACTIVE_IMPORT_REGISTER && - !ChargingStationConfigurationUtils.getConfigurationKey( + ChargingStationConfigurationUtils.getConfigurationKey( chargingStation, StandardParametersKey.MeterValuesSampledData - )?.value.includes(measurand) + )?.value.includes(measurand) === false ) { logger.debug( `${chargingStation.logPrefix()} Trying to get MeterValues measurand '${measurand}' ${onPhaseStr}in template on connectorId ${connectorId} not found in '${ @@ -104,7 +104,7 @@ export class OCPPServiceUtils { chargingStation.getConnectorStatus(connectorId).MeterValues; for ( let index = 0; - !Utils.isEmptyArray(sampledValueTemplates) && index < sampledValueTemplates.length; + Utils.isEmptyArray(sampledValueTemplates) === false && index < sampledValueTemplates.length; index++ ) { if ( -- 2.34.1