Battery percentage is only based on primary battery even if multiple batteries exist

Bug #1647127 reported by Sam Levin
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Wingpanel Power Indicator
Confirmed
Undecided
Unassigned

Bug Description

I'm using a thinkpad t430s with elementary OS 0.4. I have two batteries installed. Primary, and a smaller peripheral battery in my bay. eOS recognizes both and shows their percentages separately when I click the power icon. But it only uses the primary battery when 'show percentage' is enabled. I.e. battery power will remain at 100% until the secondary battery has fully depleted. Afterward the battery percentage will reflect the current state of the primary battery.

affects: elementaryos → wingpanel-indicator-power
Revision history for this message
Tyler Gorda (tygorda) wrote :

I am using a Thinkpad T460s, with two internal batteries. On elementary OS 0.4, I see the same behavior: only one of the batteries factors into the wingpanel percentage and only after the OS starts using that battery will the indicator percentage change.

Interestingly, I've noticed that the 'low battery warning' notification *does* factor into account both batteries. E.g., if I have the warning set for 15% battery, I will receive the notification when one of the batteries is ~5% and the other is at ~25% so that there is indeed 15% of the total power left (the batteries are of similar capacities). I've wondered if this means that the code for that notification can be used in some way to fix the wingpanel indicator.

Tyler Gorda (tygorda)
Changed in wingpanel-indicator-power:
status: New → Confirmed
Revision history for this message
Zisu Andrei (matzipan) wrote :

Hey guys,

Since we might not have access to such hardware, maybe you can help improve the component which does this, and some nice people on #elementary-dev on IRC freenode can point you in the right direction.

Alternatively, what you can do is show us the structure of your /sys folders, and where information about that secondary battery might be found.

Revision history for this message
Tyler Gorda (tygorda) wrote :

Hello,

I'd be happy to help if I can---this bug frustrates me much more than it reasonably should. :) For me, my /sys/class/power_supply has the following links:

AC -> ../../devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/
BAT0 -> ../../devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/
BAT1 -> ../../devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:01/power_supply/BAT1/

BAT0 is the one that the OS is using as the primary battery.

Also, if it is relevant, I have discovered that upower's DisplayDevice, e.g. from upower -d or upower --enumerate, combines the batteries' energies correctly and gives the right percentage and time (though not the icon-name, it seems).

Revision history for this message
Tyler Gorda (tygorda) wrote :

EDIT: The icon-name for upower's DisplayDevice seem consistent too; I misspoke.

Revision history for this message
Alimspender (akillcool) wrote :

I met the same problem that frustrates me.

And I thought some thing can be done in file:/src/Widgets/DisplayWidget.vala

http://bazaar.launchpad.net/~elementary-pantheon/wingpanel-indicator-power/master/view/head:/src/Widgets/DisplayWidget.vala

line 69-71:
    private void update_revealer () {
        percent_revealer.reveal_child = Services.SettingsManager.get_default ().show_percentage && allow_percent;
    }

I would be much grateful if this bug can be fixed, and I'm willing to help to test.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.