forked from enlightenment/enlightenment
udev: recalc last full charge on update in case battery loses maxlife between module restarts
all: do not display time if full && have power SVN revision: 48985
This commit is contained in:
parent
dd4fa1244b
commit
fb6a6462c9
|
@ -323,7 +323,11 @@ _battery_device_update(void)
|
|||
return; /* not ready yet, no properties received for any battery */
|
||||
|
||||
if (batnum > 0) full /= batnum;
|
||||
|
||||
if ((full == 100) && have_power)
|
||||
{
|
||||
time_left = -1;
|
||||
time_full = -1;
|
||||
}
|
||||
if (time_left < 1) time_left = -1;
|
||||
if (time_full < 1) time_full = -1;
|
||||
|
||||
|
|
|
@ -213,8 +213,8 @@ _battery_udev_battery_update(const char *syspath, Battery *bat)
|
|||
GET_STR(bat, model, POWER_SUPPLY_MODEL_NAME);
|
||||
GET_STR(bat, vendor, POWER_SUPPLY_MANUFACTURER);
|
||||
GET_NUM(bat, design_charge, POWER_SUPPLY_ENERGY_FULL_DESIGN);
|
||||
GET_NUM(bat, last_full_charge, POWER_SUPPLY_ENERGY_FULL);
|
||||
}
|
||||
GET_NUM(bat, last_full_charge, POWER_SUPPLY_ENERGY_FULL);
|
||||
test = eeze_udev_syspath_get_property(bat->udi, "POWER_SUPPLY_ENERGY_NOW");
|
||||
if (test)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue