From cc0c6424f2a65bf5298ff29c5339ca81f7226eed Mon Sep 17 00:00:00 2001 From: Mike Cifelli <1836280-mike-cifelli@users.noreply.gitlab.com> Date: Sat, 19 Jun 2021 08:09:37 -0400 Subject: [PATCH] Always show a value for temperature --- system-status.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/system-status.py b/system-status.py index 5c5687f..3a20a0a 100644 --- a/system-status.py +++ b/system-status.py @@ -106,10 +106,12 @@ class SystemStatus: adjusted = max(0, temp - MIN_TEMP) percent = min(1, adjusted / (MAX_TEMP - MIN_TEMP)) - return round(self.height * percent) + return max(1, round(self.height * percent)) def getCpuValue(self): - return round(self.height * (psutil.cpu_percent() / 100)) + percent = psutil.cpu_percent() / 100 + + return round(self.height * percent) def getNetworkValue(self): connections = psutil.net_connections(kind='inet')