mirror of
https://gitlab.freedesktop.org/upower/upower.git
synced 2026-01-17 03:30:19 +01:00
bugfix: fix the battery capacity calculation. Fixes fd#19165
This commit is contained in:
parent
c5e7a481d4
commit
71e40db432
1 changed files with 1 additions and 1 deletions
|
|
@ -275,7 +275,7 @@ dkp_supply_refresh_battery (DkpSupply *supply)
|
|||
|
||||
/* calculate how broken our battery is */
|
||||
if (obj->energy_full > 0) {
|
||||
obj->capacity = obj->energy_full_design / obj->energy_full * 100.0f;
|
||||
obj->capacity = (obj->energy_full / obj->energy_full_design) * 100.0f;
|
||||
if (obj->capacity < 0)
|
||||
obj->capacity = 0;
|
||||
if (obj->capacity > 100.0)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue