mirror of
https://gitlab.freedesktop.org/upower/upower.git
synced 2026-05-07 21:18:08 +02:00
linux: Fix batteries which report current energy but full charge
The condition should be for energy_full, not energy, since we aim to find some way of finding energy_full and energy_full_design irrespective of the way we find energy. https://bugs.freedesktop.org/show_bug.cgi?id=60104 Signed-off-by: Alex Hornung <alex@alexhornung.com>
This commit is contained in:
parent
b59d9848d4
commit
cff4f578e5
1 changed files with 1 additions and 1 deletions
|
|
@ -574,7 +574,7 @@ up_device_supply_refresh_battery (UpDeviceSupply *supply)
|
|||
energy_full_design = sysfs_get_double (native_path, "energy_full_design") / 1000000.0;
|
||||
|
||||
/* convert charge to energy */
|
||||
if (energy < 0.01) {
|
||||
if (energy_full < 0.01) {
|
||||
energy_full = sysfs_get_double (native_path, "charge_full") / 1000000.0;
|
||||
energy_full_design = sysfs_get_double (native_path, "charge_full_design") / 1000000.0;
|
||||
energy_full *= voltage_design;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue