From d54a743380e16133fdc5d1e4b25fa02455ea9693 Mon Sep 17 00:00:00 2001 From: Mike Cifelli <1836280-mike-cifelli@users.noreply.gitlab.com> Date: Thu, 17 Jun 2021 17:00:40 -0400 Subject: [PATCH] Round temp and cpu values --- system-status.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/system-status.py b/system-status.py index a8da57a..951eddc 100644 --- a/system-status.py +++ b/system-status.py @@ -20,8 +20,8 @@ TEMP_COLOR = RED CPU_COLOR = BLUE NETWORK_COLOR = PINK -MIN_TEMP = 40 -MAX_TEMP = 80 +MIN_TEMP = 45 +MAX_TEMP = 85 class SystemStatus: @@ -106,10 +106,10 @@ class SystemStatus: adjusted = max(0, temp - MIN_TEMP) percent = min(1, adjusted / (MAX_TEMP - MIN_TEMP)) - return int(self.height * percent) + return round(self.height * percent) def getCpuValue(self): - return int(self.height * (psutil.cpu_percent() / 100)) + return round(self.height * (psutil.cpu_percent() / 100)) def getNetworkValue(self): connections = psutil.net_connections(kind='inet')