From d936a22ff62222d0122d9ddf5db58ec50021a2fe Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Tue, 14 Dec 2021 19:53:02 +0000 Subject: e temp - use labels not paths to match sensors - more reliable the device PATHS may change - depending on probe times/order and luck, so use the labels to match as these should be more reliable boot to boot. @fix --- src/modules/temperature/e_mod_config.c | 4 ++-- src/modules/temperature/e_mod_tempget.c | 14 ++++++++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/modules/temperature/e_mod_config.c b/src/modules/temperature/e_mod_config.c index 91e801ac8b..cf5b76a540 100644 --- a/src/modules/temperature/e_mod_config.c +++ b/src/modules/temperature/e_mod_config.c @@ -81,7 +81,7 @@ _fill_data_tempget(E_Config_Dialog_Data *cfdata) EINA_LIST_FREE(sensors, sen) { if ((cfdata->inst->sensor_name) && - (!strcmp(sen->name, cfdata->inst->sensor_name))) + (!strcmp(sen->label, cfdata->inst->sensor_name))) cfdata->sensor = n; cfdata->sensors = eina_list_append(cfdata->sensors, sen); n++; @@ -192,7 +192,7 @@ _basic_apply(E_Config_Dialog *cfd EINA_UNUSED, E_Config_Dialog_Data *cfdata) sen = eina_list_nth(cfdata->sensors, cfdata->sensor); if (sen) - eina_stringshare_replace(&(cfdata->inst->sensor_name), sen->name); + eina_stringshare_replace(&(cfdata->inst->sensor_name), sen->label); e_config_save_queue(); temperature_face_update_config(cfdata->inst); diff --git a/src/modules/temperature/e_mod_tempget.c b/src/modules/temperature/e_mod_tempget.c index 15f5307429..1fd00fe134 100644 --- a/src/modules/temperature/e_mod_tempget.c +++ b/src/modules/temperature/e_mod_tempget.c @@ -601,7 +601,12 @@ init(Tempthread *tth) { EINA_LIST_FOREACH(mon->temps, ll, temp) { - tth->sensor_name = eina_stringshare_add(temp->path); + char buf[256]; + + snprintf(buf, sizeof(buf), "%s - %s", + mon->label ? mon->label : mon->name, + temp->label ? temp->label : temp->name); + tth->sensor_name = eina_stringshare_add(buf); break; } } @@ -630,7 +635,12 @@ check(Tempthread *tth) { EINA_LIST_FOREACH(mon->temps, ll, temp) { - if (!strcmp(tth->sensor_name, temp->path)) + char buf[256]; + + snprintf(buf, sizeof(buf), "%s - %s", + mon->label ? mon->label : mon->name, + temp->label ? temp->label : temp->name); + if (!strcmp(tth->sensor_name, buf)) { t = temp->temp; break; -- cgit v1.2.1