elementary / wingpanel-indicator-power

Wingpanel Power Indicator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Also show power level bluetooth headphones

peteruithoven opened this issue · comments

Prerequisites

  • I have searched open and closed issues for duplicates.

Feature

Is your feature request related to a problem? Please describe.

I love how the indicator shows me the power levels of my bluetooth devices.
But, it never includes my bluetooth headphones/headsets even when they are also connected:

Describe the solution you'd like
I'd love for these devices to also be included.

Existing work
Android is able to read out their power levels:

Describe alternatives you've considered

Additional context
Looking through the code it depends on dbus & Upower. Looking there I see that the bluetooth devices aren't listed.

Screenshot from 2020-07-26 00-08-09@2x
Some devices like the MX Keys also seem to have a org.bluez.battery1 interface

While the headphones don't have that interface:

Relevant Stack overflow question with some interesting answers:
https://stackoverflow.com/a/52899481/1544200

https://github.com/wangrunz/BluetoothMonitor#battery-level-for-bluetooth-headsets-support-handsfree-profile


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Due note that this requires to introduce the bluez dbus interface into this code base. Which is not present a this moment. It also makes it harder to know the correlation between Upower and bluez dbus interface, in order to prevent duplicate devices.

I am wondering if we can not get this information from the already used Upower interface.

If it is possible I would like to see the upower data maybe @peteruithoven @andirsun can help me out?
because I do not own wireless headsets, just a personal preference.

If possible I would like to see the output of upower -d if you could copy paste the result on this ticket. Then i could see what data is available and maybe add the battery % via the upower interface.

Sorry I didn't read the part of bluetooth devices doesn't get listed on upower interface.
But the MX keys is on both interfaces which could create duplication.

when using the device1 interface there is no easy way to get battery level (https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/doc/device-api.txt)
but there might be a way to use raw AT commands to obtain batter level when the battery1 (https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/doc/battery-api.txt) interface is not available.
Sadly some AT commands are vendor specific and is hard to maintain.

new version bluez 5.56 and higher, support battery provider
https://github.com/bluez/bluez/blob/5.60/test/example-battery-provider

@torikulhabib Do you know how to run the experimental interface un bluez bus ?
Interface org.bluez.BatteryProviderManager1 [experimental]
I upgrade bluez compiling the last version from source but I dont know how to find the BatteryProviceManager1 Interface

after installing the latest version of bluez. what looks when you're running ./example-batrey-provider.py?? ?

❯ ./example-battery-provider 
BatteryProviderManager1 interface not found

Bluetooth battery has been completely lost in Odin. I used to be able to see the battery percentage on the power indicator but not after the upgrade.