noccylabs / acpi-thermal
从sysfs读取温度值
0.1.0
2014-08-22 18:17 UTC
This package is auto-updated.
Last update: 2024-09-07 07:02:01 UTC
README
从ACPI sysfs读取温度读数
安装
$ composer require noccylabs/acpi-thermal:0.1.*
用法
您可以使用静态的getAllZones()
方法获取所有可用的热区集合
use NoccyLabs\Thermal;
$zones = Thermal\Zone::getAllZones();
foreach ($zones as $zone) {
printf("%s = %.1fºC\n",
$zone->getName(),
$zone->getTemp()
);
}
您还可以直接创建一个区域并从中开始读取(假设它存在)
$zone = new Thermal\Zone("thermal_zone0");
echo $zone->getTemp();