Skip to content

Show UPower device batteries in Bluetooth panel - #8317

Open
erbmicha wants to merge 1 commit into
basecamp:quattrofrom
erbmicha:fix/bluetooth-upower-device-battery
Open

Show UPower device batteries in Bluetooth panel#8317
erbmicha wants to merge 1 commit into
basecamp:quattrofrom
erbmicha:fix/bluetooth-upower-device-battery

Conversation

@erbmicha

Copy link
Copy Markdown

What changed

  • Fall back to UPower when a connected Bluetooth device does not expose BlueZ Battery1 data.
  • Match UPower HID batteries to Bluetooth devices by normalized address.
  • Keep native BlueZ battery readings as the preferred source.
  • Add focused model tests for fallback matching, source precedence, mismatches, and unready devices.

Testing

  • bash test/shell.d/bluetooth-test.sh
  • ./test/shell reached 180 of 184 passing test files. Three failures require the absent omarchy-pkgs checkout. The unrelated network-qr-test.sh passed when rerun alone.
  • Loaded the exact source files in the running Omarchy Bluetooth widget and visually confirmed the Apple keyboard battery displays as 3% beneath the device name without clipping or layout changes.

Copilot AI balanced review requested due to automatic review settings August 26, 2026 01:08

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

Adds UPower battery fallback support to the Bluetooth panel while preserving native BlueZ readings.

Changes:

  • Matches UPower HID batteries by normalized Bluetooth address.
  • Displays fallback battery percentages for connected devices.
  • Adds focused tests for matching, precedence, and invalid devices.

Tip

If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

Reviewed changes

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

File Description
shell/plugins/panels/bluetooth/Model.js Resolves battery percentages from BlueZ or matching UPower devices.
shell/plugins/panels/bluetooth/Panel.qml Supplies UPower devices and renders resolved percentages.
test/shell.d/bluetooth-test.sh Tests fallback matching and source precedence.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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