From a2ed82c3cf5f3ad730a92f354241fcc9f412034a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ho=C3=A0ng=20Rio?= Date: Mon, 16 Dec 2024 08:12:27 +0700 Subject: [PATCH] web: round without digits in update hourly chart --- app.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app.py b/app.py index 2e26e5c..d438852 100644 --- a/app.py +++ b/app.py @@ -158,10 +158,10 @@ def insert_hourly_chart(db_connection: sqlite3.Connection, inverter_data: dict): "UPDATE hourly_chart SET datetime = ?, pv = ?, battery = ?, grid = ?, consumption = ?, soc = ? WHERE id = ?", ( hourly_chart_item["datetime"], - round((hourly_chart_item["pv"] + exist_item["pv"]) / 2, 1), - round((hourly_chart_item["battery"] + exist_item["battery"]) / 2, 1), - round((hourly_chart_item["grid"] + exist_item["grid"]) / 2, 1), - round((hourly_chart_item["consumption"] + exist_item["consumption"]) / 2, 1), + round((hourly_chart_item["pv"] + exist_item["pv"]) / 2), + round((hourly_chart_item["battery"] + exist_item["battery"]) / 2), + round((hourly_chart_item["grid"] + exist_item["grid"]) / 2), + round((hourly_chart_item["consumption"] + exist_item["consumption"]) / 2), round((hourly_chart_item["soc"] + exist_item["soc"]) / 2), item_id) )