Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bluetooth module: fetch battery percentage from upower if not found from bluez #2886

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

levnikmyskin
Copy link

What is this PR about?

Current bluetooth module shows battery percentage from bluez experimental features. This has two drawbacks:

  1. Not super user friendly, as users need to activate these features;
  2. Most importantly, a lot of devices (at least in my experience) do not report battery percentage anyway, despite having it in upower;

Upower implementation

In this PR, the bluetooth module will first try to fetch battery percentage from bluez and, if not available, will try fetching it from upower.

Other details

At the moment, the code is getting all upower devices, and then looking for the one with the correct serial number. I don't know if there's a better way of doing this

src/modules/bluetooth.cpp Outdated Show resolved Hide resolved
Co-authored-by: Alexis Rouillard <alexisr245@gmail.com>
@levnikmyskin
Copy link
Author

Thank you for your suggestions, implemented :)

@levnikmyskin
Copy link
Author

Hi @Alexays, is there anything missing here or could we merge this? thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants