I have no idea which library is involved in accessing the data.

it seems as for (my) Linux system the sensor data can be collected from plain text files located in one of four following directories:


/sys/class/hwmon/hwmon0/
/sys/class/hwmon/hwmon1/
/sys/class/hwmon/hwmon2/
/sys/class/hwmon/hwmon3/

It also seems as the sensors are assigned different directories after each restart.

Fortunately there are only four directories (in my system) and there is a plain text file named 'name' in each directory saying which sensors were assigned there during the last/current restart.

/sys/class/hwmon/hwmon'*/name

So first make a routine to check which directory to look in and then retrieve the actual data from files of the type

/sys/class/hwmon/hwmon*/temp*_input

Then you do whatever magic you want to do with this temperature data
it seems the temperature files are updated every 2 seconds.

From what I read different systems behave differently. So I guess it depends on what you got under the hood. So far I have only tried this on my own computer.