put temperature conversion functions into a separate file.
[psensor.git] / src / lib / psensor.c
index f4d9659..9f063d0 100644 (file)
 #include <libintl.h>
 #define _(str) gettext(str)
 
-#include "hdd.h"
-#include "psensor.h"
-#include "lmsensor.h"
+#include <hdd.h>
+#include <psensor.h>
+#include <lmsensor.h>
+#include <temperature.h>
 
 #ifdef HAVE_GTOP
 #include "cpu.h"
@@ -209,16 +210,6 @@ int is_fan_type(unsigned int type)
        return type & SENSOR_TYPE_FAN;
 }
 
-double celsius_to_fahrenheit(double c)
-{
-       return c * (9.0/5.0) + 32;
-}
-
-double fahrenheit_to_celsius(double f)
-{
-       return (f - 32) * (5.0/9.0);
-}
-
 char *
 psensor_value_to_str(unsigned int type, double value, int use_celsius)
 {
@@ -437,8 +428,12 @@ struct psensor **get_all_sensors(int use_libatasmart, int values_max_length)
 
 const char *psensor_type_to_str(unsigned int type)
 {
-       if (type & SENSOR_TYPE_NVCTRL)
-               return "NVIDIA GPU";
+       if (type & SENSOR_TYPE_NVCTRL) {
+               if (type & SENSOR_TYPE_TEMP)
+                       return "NVIDIA GPU Temperature";
+               else
+                       return "NVIDIA GPU";
+       }
 
        if (type & SENSOR_TYPE_ATIADL) {
                if (type & SENSOR_TYPE_TEMP)