Eight Sleep catch missing keys (#81058)

Catch missing keys
This commit is contained in:
mezz64
2022-10-27 01:37:48 -04:00
committed by GitHub
parent e785d04abf
commit 24ab6fc31d

View File

@@ -146,7 +146,7 @@ def _get_breakdown_percent(
"""Get a breakdown percent."""
try:
return round((attr["breakdown"][key] / denominator) * 100, 2)
except ZeroDivisionError:
except (ZeroDivisionError, KeyError):
return 0