Skip to content

Commit

Permalink
Fix var access
Browse files Browse the repository at this point in the history
  • Loading branch information
NickM-27 committed Dec 13, 2022
1 parent 53b4acc commit 9099a42
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions custom_components/frigate/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,11 +287,11 @@ def state(self) -> float | None:
data = (
self.coordinator.data.get("gpu_usages", {})
.get(self._gpu_name, {})
.get("gpu_usage")
.get("gpu")
)
if data is not None:
try:
return float(data.replace("%", ""))
return float(data.replace("%", "").strip())
except ValueError:
pass
return None
Expand Down

0 comments on commit 9099a42

Please sign in to comment.