From 6fc73851aaa711c0ea56cde766e49d7311c21abd Mon Sep 17 00:00:00 2001 From: Weylin-fr Date: Mon, 20 Jan 2020 16:27:19 +0100 Subject: [PATCH] Update system.php get CPU temp from "/sys/class/thermal/thermal_zone0/temp" --- app/lib/system.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/lib/system.php b/app/lib/system.php index e7007d0a..4e4c8879 100644 --- a/app/lib/system.php +++ b/app/lib/system.php @@ -45,5 +45,10 @@ class System { public function systemLoadPercentage() { return intval(($this->loadAvg1Min() * 100) / $this->processorCount()); } + + public function systemTemperature() { + $cpuTemp = file_get_contents("/sys/class/thermal/thermal_zone0/temp"); + return number_format($cpuTemp/1000, 1); + } }