summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKim Woelders <kim@woelders.dk>2018-10-06 17:54:07 +0200
committerKim Woelders <kim@woelders.dk>2018-11-03 07:25:28 +0100
commitc00cefd35ed19131cc11568296f2715ac57f017d (patch)
tree73d147de8beb0d2025d6590eef898a21dc4d14c8
parent3b703b57a2a01e3eb65ed0380299c7a39a38d15a (diff)
E-Power: Enable using POWER_SUPPLY_POWER_NOW and POWER_SUPPLY_ENERGY_... too
-rw-r--r--epplets/E-Power.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/epplets/E-Power.c b/epplets/E-Power.c
index 1962edc..033549b 100644
--- a/epplets/E-Power.c
+++ b/epplets/E-Power.c
@@ -295,6 +295,26 @@ _bat_info_fetch_sys(bat_info_t * bi)
295 bi->level_unknown = 0; 295 bi->level_unknown = 0;
296 bi->bat_level += atoi(value); 296 bi->bat_level += atoi(value);
297 } 297 }
298 else if (strcmp(key, "POWER_SUPPLY_POWER_NOW") == 0)
299 {
300 bi->rate_unknown = 0;
301 bi->bat_drain += atoi(value) / 1000;
302 }
303 else if (strcmp(key, "POWER_SUPPLY_ENERGY_FULL_DESIGN") == 0)
304 {
305 bi->design_cap_unknown = 0;
306 bi->bat_max += atoi(value) / 1000;
307 }
308 else if (strcmp(key, "POWER_SUPPLY_ENERGY_FULL") == 0)
309 {
310 bi->last_full_unknown = 0;
311 bi->bat_filled += atoi(value) / 1000;
312 }
313 else if (strcmp(key, "POWER_SUPPLY_ENERGY_NOW") == 0)
314 {
315 bi->level_unknown = 0;
316 bi->bat_level += atoi(value) / 1000;
317 }
298 } 318 }
299 fclose(f); 319 fclose(f);
300 } 320 }