aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/temperature/e_mod_main.c
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2016-12-04 22:46:02 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2016-12-04 22:46:02 +0900
commita15ac5f039bf28e35ce4fb6d54630955a8e61953 (patch)
tree87e0fc030658d20983b28773362981ee86619ca4 /src/modules/temperature/e_mod_main.c
parente cpufreq - dont emit message for min/max/cur freq if they didnt change (diff)
downloadenlightenment-a15ac5f039bf28e35ce4fb6d54630955a8e61953.tar.gz
temp module - avoid a bit of cpu sendingh edje message if temp same
each poll - check if temp actually changed and only send edje message if tempt actually did change. saves some cpu while polling in the bg for these things. @optimize
Diffstat (limited to 'src/modules/temperature/e_mod_main.c')
-rw-r--r--src/modules/temperature/e_mod_main.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/modules/temperature/e_mod_main.c b/src/modules/temperature/e_mod_main.c
index f1e242228..861e31332 100644
--- a/src/modules/temperature/e_mod_main.c
+++ b/src/modules/temperature/e_mod_main.c
@@ -77,6 +77,8 @@ _temperature_apply(Config_Face *inst, int temp)
{
char buf[64];
+ if (inst->temp == temp) return;
+ inst->temp = temp;
if (temp != -999)
{
if (inst->units == FAHRENHEIT) temp = (temp * 9.0 / 5.0) + 32;
@@ -139,6 +141,7 @@ _gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style)
inst->high = 80;
inst->sensor_type = SENSOR_TYPE_NONE;
inst->sensor_name = NULL;
+ inst->temp = -900;
inst->units = CELSIUS;
#ifdef HAVE_EEZE
inst->backend = UDEV;