GNOME Bugzilla – Bug 701993
Wrong battery indicator when fully charged (99% instead of 100%)
Last modified: 2014-01-21 11:44:43 UTC
Created attachment 246490 [details] Screenshot Steps to reproduce: 1. Plug in power cord and wait to fully charge 2. Go to System Settings and select Power Expected result: Battery indicatior should indicate 100% Actual result: Battery indicatior indicates 99% Notes: - This is not 100% reproducible. - After restart, the indicator still shows 99% instead of 100%
Additional info: See on lenovo X230 Tablet, fedora 19 and Gnome version 3.8.2
What's the output of "upower -d" on this machine?
This is the output of "upower -d" on my machine: Device: /org/freedesktop/UPower/devices/line_power_AC native-path: /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:08/PNP0C09:00/ACPI0003:00/power_supply/AC power supply: yes updated: Tue Jun 11 04:00:29 2013 (8035 seconds ago) has history: no has statistics: no line-power online: yes Device: /org/freedesktop/UPower/devices/battery_BAT0 native-path: /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:08/PNP0C09:00/PNP0C0A:00/power_supply/BAT0 vendor: LGC model: 45N1079 serial: 8340 power supply: yes updated: Tue Jun 11 06:14:06 2013 (18 seconds ago) has history: yes has statistics: yes battery present: yes rechargeable: yes state: fully-charged energy: 64.3 Wh energy-empty: 0 Wh energy-full: 64.8 Wh energy-full-design: 62.16 Wh energy-rate: 0 W voltage: 12.723 V percentage: 99.2284% capacity: 100% technology: lithium-ion Daemon: daemon-version: 0.9.20 can-suspend: yes can-hibernate: yes on-battery: no on-low-battery: no lid-is-closed: no lid-is-present: yes is-docked: no
I'm not sure what to do here. The battery has stopped charging slightly before 100% and marked itself as fully charged. We could just force 100% to be in the UI in that case, although that would be a lie.
It would also reflect expectations better. If it says "fully-charged" and we're within 1% of 100%, we can show "100%" and stop stressing the user out.
Created attachment 266790 [details] [review] proposed patch
Review of attachment 266790 [details] [review]: ::: panels/power/cc-power-panel.c @@ +315,3 @@ time = time_full; + /* Workaround for https://bugzilla.gnome.org/show_bug.cgi?id=701993 I'd rather have a full explanation rather than a bug link, the bug link already is in the commit log. @@ +318,3 @@ + If the reported status is fully charged and battery is at 99%, + just show 100% */ + if (state == UP_DEVICE_STATE_FULLY_CHARGED && (100.0 - percentage <= 1)) 100.0 is a float, percentage is a float, 1 is an int.
Created attachment 266849 [details] [review] proposed patch, v2
Review of attachment 266849 [details] [review]: Looks good for master and gnome-3-10
thanks, pushed to both branches.