From e09fbaaf9a47b903ae6b96e59006e2054247b163 Mon Sep 17 00:00:00 2001 From: Lutz Bender Date: Mon, 5 Feb 2024 11:11:22 +0100 Subject: [PATCH 1/2] fix analyzing percentages --- .../helpermodules/measurement_logging/process_log.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/helpermodules/measurement_logging/process_log.py b/packages/helpermodules/measurement_logging/process_log.py index 4d59a2948e..d9eca49cc0 100644 --- a/packages/helpermodules/measurement_logging/process_log.py +++ b/packages/helpermodules/measurement_logging/process_log.py @@ -286,7 +286,7 @@ def add_daily_log(day: str) -> None: def _analyse_energy_source(data) -> Dict: - if data: + if data and len(data["entries"]) > 0: for i in range(0, len(data["entries"])): data["entries"][i] = analyse_percentage(data["entries"][i]) data["totals"] = analyse_percentage_totals(data["entries"], data["totals"]) @@ -337,13 +337,16 @@ def format(value): def analyse_percentage_totals(entries, totals): + for section in ("hc", "cp"): + if "all" not in totals[section].keys(): + totals[section]["all"] = {} for source in ("grid", "pv", "bat", "cp"): totals["hc"]["all"].update({f"energy_imported_{source}": 0}) totals["cp"]["all"].update({f"energy_imported_{source}": 0}) for entry in entries: - if "all" in entry["hc"].keys(): + if "hc" in entry.keys() and "all" in entry["hc"].keys(): totals["hc"]["all"][f"energy_imported_{source}"] += entry["hc"]["all"][f"energy_imported_{source}"]*1000 - if "all" in entry["cp"].keys(): + if "all" in entry["cp"].keys() and f"energy_imported_{source}" in entry["cp"]["all"].keys(): totals["cp"]["all"][f"energy_imported_{source}"] += entry["cp"]["all"][f"energy_imported_{source}"]*1000 return totals From 5df2332301ff4dd6d9acaf9f8b4df8d036512853 Mon Sep 17 00:00:00 2001 From: Lutz Bender Date: Mon, 5 Feb 2024 11:51:09 +0100 Subject: [PATCH 2/2] fix display of "coins" in charge point header --- packages/modules/web_themes/standard_legacy/web/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/modules/web_themes/standard_legacy/web/index.html b/packages/modules/web_themes/standard_legacy/web/index.html index 81725c6ff7..5ebb6c9ba1 100644 --- a/packages/modules/web_themes/standard_legacy/web/index.html +++ b/packages/modules/web_themes/standard_legacy/web/index.html @@ -410,8 +410,8 @@
-- - - + +