22/08
2014
Wallogit.com
2017 © Pedro Peláez
Read thermal temperature values from sysfs
Read the temperature readings from the ACPI sysfs, (*1)
$ composer require noccylabs/acpi-thermal:0.1.*
You can get a collection of all the available thermal zones using the static
getAllZones() method:, (*2)
use NoccyLabs\Thermal;
$zones = Thermal\Zone::getAllZones();
foreach ($zones as $zone) {
printf("%s = %.1fºC\n",
$zone->getName(),
$zone->getTemp()
);
}
You can also create a zone directly and start reading from it (assuming it exists):, (*3)
$zone = new Thermal\Zone("thermal_zone0");
echo $zone->getTemp();