summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2021-12-14 19:53:02 +0000
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2021-12-14 19:53:02 +0000
commitd936a22ff62222d0122d9ddf5db58ec50021a2fe (patch)
treed1f4c1b3a732f6d882a225c5cf6f582fb7dfe716
parent988df49defebd478a93d7691f25ffdb2bce25719 (diff)
downloadenlightenment-d936a22ff62222d0122d9ddf5db58ec50021a2fe.tar.gz
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
-rw-r--r--src/modules/temperature/e_mod_config.c4
-rw-r--r--src/modules/temperature/e_mod_tempget.c14
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;