[Pkg-acpi-devel] Bug#885623: Acpitool can't handle more than 2 batteries (with patch)

Ryan Thoryk ryan at thoryk.com
Thu Dec 28 17:27:45 UTC 2017


Package: acpitool
Version: 0.5.1-4+b4
Severity: important
Tags: patch

I've been having an issue with acpitool's battery reporting on my laptop.  I'm using a ThinkPad T460, which has 2 batteries, and I have a USB wireless mouse that reports as a third battery.  I found that acpitool can't handle reporting more than 2 batteries, resulting in this output:
---
ryan at t460:~$ acpitool -B
   Battery #1     : slot empty
   Battery #2     : slot empty
Invalid battery number, fix this
   Battery #3     : slot empty
---

I've attached a patch which fixes this issue, by correcting some bad code.

Output from the patched version:
---
ryan at t460:~$ acpitool -B
   Battery #1     : present
     Remaining capacity : 22620 mWh, 99.78%
     Design capacity    : 23480 mWh
     Last full capacity : 22670 mWh, 96.55% of design capacity
     Capacity loss      : 3.450%
     Present rate       : 0 mW
     Charging state     : Unknown
     Battery type       : Li-ion
     Model number       : 45N1113
     Serial number      : 4292
   Battery #2     : present
     Remaining capacity : 22810 mWh, 96.65%, 00:22:49
     Design capacity    : 23200 mWh
     Last full capacity : 23600 mWh
     Present rate       : 2077 mW
     Charging state     : Charging
     Battery type       : Li-ion
     Model number       : 45N1775
     Serial number      : 7141
   Battery #3     : slot empty
---

-- 
Ryan Thoryk
ryan at thoryk.com
ryan at tliquest.net

-------------- next part --------------
A non-text attachment was scrubbed...
Name: count.patch
Type: text/x-patch
Size: 1512 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-acpi-devel/attachments/20171228/56d5c8f8/attachment.bin>


More information about the Pkg-acpi-devel mailing list