sensors: Use quantity unit to determine when to translate to fahrenheit

This commit is contained in:
Michal Suchanek
2023-12-28 13:02:52 +01:00
parent 297b050d3d
commit fcf478016d
+2 -2
View File
@@ -60,7 +60,7 @@ void print_chip_raw(const sensors_chip_name *name)
b = 0;
while ((sub = sensors_get_all_subfeatures(name, feature, &b))) {
if (sub->flags & SENSORS_MODE_R) {
is_temp = feature->type == SENSORS_FEATURE_TEMP;
is_temp = !strcmp("°C", sensors_get_quantity(sub->type)->unit);
if ((err = sensors_get_value(name, sub->number,
&val)))
@@ -105,7 +105,7 @@ void print_chip_json(const sensors_chip_name *name)
subCnt = 0;
while ((sub = sensors_get_all_subfeatures(name, feature, &b))) {
if (sub->flags & SENSORS_MODE_R) {
is_temp = feature->type == SENSORS_FEATURE_TEMP;
is_temp = !strcmp("°C", sensors_get_quantity(sub->type)->unit);
if ((err = sensors_get_value(name, sub->number,
&val))) {