Always show a value for temperature

This commit is contained in:
Mike Cifelli 2021-06-19 08:09:37 -04:00
parent c530de28d6
commit cc0c6424f2
1 changed files with 4 additions and 2 deletions

View File

@ -106,10 +106,12 @@ class SystemStatus:
adjusted = max(0, temp - MIN_TEMP) adjusted = max(0, temp - MIN_TEMP)
percent = min(1, adjusted / (MAX_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): def getCpuValue(self):
return round(self.height * (psutil.cpu_percent() / 100)) percent = psutil.cpu_percent() / 100
return round(self.height * percent)
def getNetworkValue(self): def getNetworkValue(self):
connections = psutil.net_connections(kind='inet') connections = psutil.net_connections(kind='inet')