Skip to content

bluetooth: try getting battery percentage from upower if missing from bluez#2967

Open
jinliu wants to merge 1 commit into
noctalia-dev:mainfrom
jinliu:feature/bluetooth-batt-upower
Open

bluetooth: try getting battery percentage from upower if missing from bluez#2967
jinliu wants to merge 1 commit into
noctalia-dev:mainfrom
jinliu:feature/bluetooth-batt-upower

Conversation

@jinliu

@jinliu jinliu commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Bluetooth widget / tab will now also query UPowerService for battery percentage if BluetoothService doesn't provide it.

An example of this is the Playstation 5 controller.

Copilot AI review requested due to automatic review settings June 10, 2026 09:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds a UPower-based fallback to display Bluetooth device battery percentages when BlueZ doesn’t report them.

Changes:

  • Pass UPowerService* into Control Center’s BluetoothTab and the bar BluetoothWidget.
  • Query UPower by Bluetooth address to show battery % in the device list rows and widget tooltip.
  • Normalize Bluetooth addresses via StringUtils::toLower(...) before querying UPower.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/shell/control_center/control_center_panel.cpp Wires UPowerService* into BluetoothTab construction.
src/shell/control_center/bluetooth_tab.h Extends BluetoothTab API to accept/store UPowerService*.
src/shell/control_center/bluetooth_tab.cpp Uses UPower as fallback battery source for device rows.
src/shell/bar/widgets/bluetooth_widget.h Extends BluetoothWidget API to accept/store UPowerService*.
src/shell/bar/widgets/bluetooth_widget.cpp Uses UPower as fallback battery source in tooltip.
src/shell/bar/widget_factory.cpp Passes m_upower into BluetoothWidget creation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/shell/control_center/bluetooth_tab.cpp Outdated
Comment thread src/shell/bar/widgets/bluetooth_widget.cpp
Comment thread src/shell/bar/widgets/bluetooth_widget.cpp
… bluez

Bluetooth widget / tab will now also query UPowerService for battery percentage
if BluetoothService doesn't provide it.

An example of this is the Playstation 5 controller.
@jinliu jinliu force-pushed the feature/bluetooth-batt-upower branch from 1917b26 to 29d15fb Compare June 12, 2026 03:04
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.

2 participants