Bug 90886

Summary: 0% charge shown for Apple Wireless Keyboard
Product: upower Reporter: Rick Ucker <rick.ucker>
Component: generalAssignee: Richard Hughes <richard>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium CC: rick.ucker
Version: unspecified   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description Rick Ucker 2015-06-07 15:24:20 UTC
This was originally reported downstream, in Ubuntu 13.10: https://bugs.launchpad.net/ubuntu/+source/upower/+bug/1245287

I am not the downstream reporter. I have experienced this bug in Ubuntu 14.10 and 15.04.

$ upower -d
[snip]
Device: /org/freedesktop/UPower/devices/battery_hid_e8o06o88o43o52od2_battery
  native-path:          hid-e8:06:88:43:52:d2-battery
  model:                Apple Wireless Keyboard
  power supply:         no
  updated:              Sun 07 Jun 2015 11:05:22 AM EDT (27 seconds ago)
  has history:          yes
  has statistics:       yes
  battery
    present:             yes
    rechargeable:        yes
    state:               discharging
    warning-level:       action
    energy:              0 Wh
    energy-empty:        0 Wh
    energy-full:         0 Wh
    energy-full-design:  0 Wh
    energy-rate:         0 W
    percentage:          0%
    capacity:            100%
    icon-name:          'battery-caution-symbolic'
[snip]

Here's what I see in syslog:
upowerd[7898]: (upowerd:7898): UPower-Linux-WARNING **: no valid voltage value found for device /sys/devices/pci0000:00/0000:00:14.0/usb1/1-8/1-8:1.0/bluetooth/hci0/hci0:256/0005:05AC:0239.001B/power_supply/hid-e8:06:88:43:52:d2-battery, assuming 10V
Comment 1 Bastien Nocera 2017-09-08 15:17:53 UTC
Do you still see the same problem with a recent version (0.99.x) of UPower?
If so, could you please paste the output of:
for i in /sys/class/power_supply/* ; do find $i/ -type f -print -exec cat '{}' \; ; done

This should print the value in sysfs which the mouse offers up.
Comment 2 Rick Ucker 2017-09-16 01:18:12 UTC
I can confirm that this now works properly with upower v 0.99.4-4 (Ubuntu 17.04). The keyboard's battery status shows up in Ubuntu's power applet, and I see a valid charge percentage reported by upower -d:

Device: /org/freedesktop/UPower/devices/keyboard_hid_e8o06o88o43o52od2_battery
  native-path:          hid-e8:06:88:43:52:d2-battery
  model:                Rick Ucker’s Keyboard
  power supply:         no
  updated:              Fri 15 Sep 2017 09:06:11 PM EDT (94 seconds ago)
  has history:          yes
  has statistics:       yes
  keyboard
    present:             yes
    rechargeable:        yes
    state:               discharging
    warning-level:       none
    percentage:          67%
    icon-name:          'battery-full-symbolic'

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.