Fix metervalues generator.
authorJérôme Benoit <jerome.benoit@sap.com>
Tue, 20 Oct 2020 15:36:32 +0000 (17:36 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Tue, 20 Oct 2020 15:36:32 +0000 (17:36 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/charging-station/ChargingStation.js

index 397bef201e8a3febe94c8ccacce849ee6b51bab5..b691b210bedc94d182e8b3393c319e9b2736b264 100644 (file)
@@ -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;