@Override public int getTotalEnergyMeterValue() { List<CachedMeteringValue> cachedEnergyMeteringValues = digitalSTROMClient.getLatest( connMan.getSessionToken(), MeteringTypeEnum.energy, meters, MeteringUnitsEnum.Wh); if (cachedEnergyMeteringValues != null) { tempEnergyMeter = 0; for (CachedMeteringValue value : cachedEnergyMeteringValues) { tempEnergyMeter += value.getValue(); } if (tempEnergyMeter != totalEnergyMeter) { totalEnergyMeter = tempEnergyMeter; } } return totalEnergyMeter; }
@Override public int getTotalPowerConsumption() { List<CachedMeteringValue> cachedConsumptionMeteringValues = digitalSTROMClient.getLatest( connMan.getSessionToken(), MeteringTypeEnum.consumption, meters, MeteringUnitsEnum.W); if (cachedConsumptionMeteringValues != null) { tempConsumption = 0; for (CachedMeteringValue value : cachedConsumptionMeteringValues) { tempConsumption += value.getValue(); } if (tempConsumption != totalPowerConsumption) { totalPowerConsumption = tempConsumption; } } return totalPowerConsumption; }