From dedf7ec4cedfcd3b5bb9704d2d17bc72f08f7246 Mon Sep 17 00:00:00 2001 From: siddydutta Date: Mon, 30 May 2022 09:04:04 +0530 Subject: [PATCH] correct site stats update --- redisolar/dao/redis/site_stats.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redisolar/dao/redis/site_stats.py b/redisolar/dao/redis/site_stats.py index 9b950865..e91d5072 100644 --- a/redisolar/dao/redis/site_stats.py +++ b/redisolar/dao/redis/site_stats.py @@ -51,7 +51,7 @@ def _update_basic(self, key: str, reading: MeterReading) -> None: max_capacity = self.redis.hget(key, SiteStats.MAX_CAPACITY) if not max_capacity or reading.current_capacity > float(max_capacity): - self.redis.hset(key, SiteStats.MAX_CAPACITY, reading.wh_generated) + self.redis.hset(key, SiteStats.MAX_CAPACITY, reading.current_capacity) def _update_optimized(self, key: str, meter_reading: MeterReading, pipeline: redis.client.Pipeline = None) -> None: