Documentation ¶
Index ¶
Constants ¶
const SensorPath = "/sys/class/hwmon"
Variables ¶
This section is empty.
Functions ¶
func FindSensorPath ¶ added in v0.7.0
Searches all directories under SensorPath, following symbolic links, for an hwmonX/name file whose contents matches name and a *_input file whose corresponding *_label file matches label. Returns the full path to the matching *_input file containing the sensor data, or an error if no match was was found.
func GetSensorValue ¶
Returns the sensor value in its raw form as exposed by the /sys file system. For example, with the Intel Core i9-12900k, the temperature will be returned as an integer value in degrees Celcius. Fractional parts of the temperature (if supported by the CPU) will require conversion. Simply put, if the temperature is 20.5 degrees Celcius, the value returned by this function will be 20500.
The sensor string must be a valid full path to the sensor:
- /sys/class/hwmon/hwmon1/temp1_input
Any error that prevents reading the value will be returned.
func ReadSensorValue ¶
Converts a value returned by GetSensorValue into a float64 temperature in degrees Celcius.
Types ¶
This section is empty.