Skip to content

feat(wireless_battery): add widget showing wireless device batteries from BatteryHub - #1249

Open
Nescabir wants to merge 1 commit into
amnweb:mainfrom
Nescabir:feat/wireless-battery-widget
Open

Nescabir wants to merge 1 commit into
amnweb:mainfrom
Nescabir:feat/wireless-battery-widget

Conversation

@Nescabir

@Nescabir Nescabir commented Nov 20, 2026 •

Copy link
Copy Markdown

Summary

Adds a wireless_battery widget that shows the battery level of wireless mice, keyboards, headsets and controllers.

Levels come from BatteryHub, which supports many brands (Logitech, Razer, SteelSeries, Corsair, HyperX, Xbox/PlayStation, Bluetooth devices...). The widget runs BatteryHub.exe --json on a background thread (one shared worker for all instances) and renders one entry per device.

  • One .device frame per device, with CSS classes for kind and state (normal, low, critical, charging, asleep, unknown, disconnected)
  • Options: label templates, devices / kinds filters, sort_by, per-kind icons, thresholds, show_disconnected, hide_when_empty, tooltip
  • Callback refresh (default on left click) polls right away
  • Docs in docs/widgets/(Widget)-Wireless-Battery.md and the sidebar
  • README.md and schema.json are untouched, as described in Contributing

BatteryHub is an external dependency the user installs; the executable name or path is set with executable.

Testing

  • New unit tests in tests/widgets/test_wireless_battery.py (JSON parsing, filtering, status/icon logic, rendering)
  • ruff check and ruff format --check clean, full test suite passes
  • pre-commit hooks (ruff-check, ruff-format) pass
  • Tested manually in a real YASB install with BatteryHub and real devices

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.

1 participant