Skip to content

Commit

Permalink
app hassgraph: fix case of unknown values
Browse files Browse the repository at this point in the history
  • Loading branch information
ChaosKid42 committed Dec 21, 2024
1 parent 4e5c304 commit 0603ddd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/hassgraph/hass_graph.star
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down Expand Up @@ -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"])
Expand Down

0 comments on commit 0603ddd

Please sign in to comment.