From: Jérôme Benoit Date: Tue, 20 Oct 2020 15:36:32 +0000 (+0200) Subject: Fix metervalues generator. X-Git-Tag: v1.0.1-0~267 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=f4e4184e48126e45d8def8084910e05f46ca6af5;p=e-mobility-charging-stations-simulator.git Fix metervalues generator. Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/ChargingStation.js b/src/charging-station/ChargingStation.js index 397bef20..b691b210 100644 --- a/src/charging-station/ChargingStation.js +++ b/src/charging-station/ChargingStation.js @@ -550,7 +550,7 @@ class ChargingStation { } else if (!sampledValueLcl.sampledValue[index].measurand || sampledValueLcl.sampledValue[index].measurand === 'Energy.Active.Import.Register') { // Persist previous value in connector const consumption = Utils.getRandomInt(self._stationInfo.maxPower / 3600000 * interval); - if (connector && connector.lastConsumptionValue && connector.lastConsumptionValue >= 0) { + if (connector && connector.lastConsumptionValue >= 0) { connector.lastConsumptionValue += consumption; } else { connector.lastConsumptionValue = 0;