From 0603dddca7d2d8f9007b66c54b7087be5c7dc0d4 Mon Sep 17 00:00:00 2001 From: Christoph Scholz Date: Sat, 7 Dec 2024 10:14:48 +0100 Subject: [PATCH] app hassgraph: fix case of unknown values --- apps/hassgraph/hass_graph.star | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/hassgraph/hass_graph.star b/apps/hassgraph/hass_graph.star index 5b92819f3..675057426 100644 --- a/apps/hassgraph/hass_graph.star +++ b/apps/hassgraph/hass_graph.star @@ -100,7 +100,7 @@ def calculate_hourly_average(data): index = 0 for entry in data: - if entry["state"] == "unavailable": + if entry["state"] == "unavailable" or entry["state"] == "unknown": continue timestamp = entry["last_changed"] @@ -135,7 +135,7 @@ def calc_stats(timezone, data): count = 0 for entry in data: - if entry["state"] == "unavailable": + if entry["state"] == "unavailable" or entry["state"] == "unknown": continue value = float(entry["state"])