raster pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=d936a22ff62222d0122d9ddf5db58ec50021a2fe

commit d936a22ff62222d0122d9ddf5db58ec50021a2fe
Author: Carsten Haitzler <[email protected]>
Date:   Tue Dec 14 19:53:02 2021 +0000

    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 91e801ac8..cf5b76a54 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 15f530742..1fd00fe13 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;

-- 


Reply via email to