Skip to content

Commit

Permalink
fix cpu temp
Browse files Browse the repository at this point in the history
  • Loading branch information
schech1 committed Oct 21, 2024
1 parent 646655d commit 1b63d6a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion backend/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,14 @@ def getSystemInfo():
systemInfo["diskUsed"] = round((disk.total - disk.free) / 1024**3, 2)
systemInfo["diskFree"] = round(disk.free / 1024**3, 2)
systemInfo["diskPercent"] = round((disk.total - disk.free) / disk.total * 100, 2)
systemInfo["cputemp"] = psutil.sensors_temperatures()

temps = psutil.sensors_temperatures()
if "cpu_thermal" in temps:
cpu_temp = temps["cpu_thermal"][0].current
systemInfo["cputemp"] = cpu_temp
else:
self.logger.info("CPU temperature sensor not found.")


# Backend version
version_file_path = '/app/VERSION'
Expand Down

0 comments on commit 1b63d6a

Please sign in to comment.