Skip to content

Commit

Permalink
Fixed crash when eth is disconnected, ref #102
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaae committed Apr 25, 2024
1 parent 85edadb commit a59ea1e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions custom_components/truenas/coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -491,13 +491,18 @@ def get_systemstats(self) -> None:
tmp_val = (
tmp_graph[i]["aggregations"]["mean"][tmp_var]
or 0.0
if tmp_var
in tmp_graph[i]["aggregations"]["mean"]
else 0.0
)
self.ds["interface"][tmp_etc][tmp_var] = round(
(tmp_val * 0.12207), 2
)
else:
tmp_val = (
tmp_graph[i]["aggregations"]["mean"][e] or 0.0
if e in tmp_graph[i]["aggregations"]["mean"]
else 0.0
)
self.ds["interface"][tmp_etc][tmp_var] = round(
(tmp_val / 1024), 2
Expand Down

0 comments on commit a59ea1e

Please sign in to comment.