From cb64194b9dbb79e5321e5bae47eb4ebf6802e2fd Mon Sep 17 00:00:00 2001 From: Roland Date: Sun, 13 Aug 2023 11:02:11 -0600 Subject: [PATCH] High/critical temperatures may be 0. --- wrolpi/status.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/wrolpi/status.py b/wrolpi/status.py index 591988a9..0618a559 100755 --- a/wrolpi/status.py +++ b/wrolpi/status.py @@ -115,7 +115,14 @@ def get_cpu_info_psutil() -> CPUInfo: high_temperature = int(temp.get(name)[0].high or 0) critical_temperature = int(temp.get(name)[0].critical or 0) + # Temperatures my not exist. + if not high_temperature: + high_temperature = 60 + if not critical_temperature: + critical_temperature = 95 + if high_temperature and high_temperature == critical_temperature: + # Display yellow warning before red warning. high_temperature = critical_temperature - 25 info = CPUInfo(