Update system.php

get CPU temp from "/sys/class/thermal/thermal_zone0/temp"
This commit is contained in:
Weylin-fr 2020-01-20 16:27:19 +01:00 committed by GitHub
parent 419e10a5b2
commit 6fc73851aa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -45,5 +45,10 @@ class System {
public function systemLoadPercentage() { public function systemLoadPercentage() {
return intval(($this->loadAvg1Min() * 100) / $this->processorCount()); 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);
}
} }