Thermal : CPU temperature detection
This module is used to obtain the current operating temperature of the CPU.
User can use the following code to import the Thermal
module.
var Thermal = require('thermal');
Support
The following shows Thermal
module APIs available for each permissions.
User Mode | Privilege Mode | |
---|---|---|
Thermal | ● | |
Thermal.exists | ● | |
thermal.close | ● | |
thermal.read | ● |
Thermal Class
new Thermal()
- Returns: {Object} A new thermal object.
Create a thermal
object.
Thermal.exists()
- Returns: {Boolean} Whether there is an thermal device.
Whether there is an thermal device, if there is no new
operation will throw an exception.
Example
if (Thermal.exists()) {
var thermal = new Thermal();
}
Thermal Object
thermal.close()
Close thermal object.
thermal.read([fa])
fa
{Boolean} Whether to get Fahrenheit temperature. default: false.- Returns: {Number} CPU current temperature.
Get current CPU temperature.
Example
var thermal = new Thermal();
var celsius = thermal.read();
var fahrenheit = thermal.read(true);