[PR #1357] [MERGED] Refactor battery client code, add mock battery client #1325

Closed
opened 2026-05-22 21:56:15 +01:00 by JakeStanger · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/JakeStanger/ironbar/pull/1357
Author: @JakeStanger
Created: 1/31/2026
Status: Merged
Merged: 2/1/2026
Merged by: @JakeStanger

Base: masterHead: refactor/battery2


📝 Commits (4)

  • b769b81 refactor(battery): fully move client code to clients/upower
  • d0ddd51 test(battery): add mock client
  • ed98bf7 ci: fix incorrect warnings flag
  • 6f5f228 ci(build): allow unused macros in feature checks

📊 Changes

8 files changed (+323 additions, -161 deletions)

View changed files

📝 .github/workflows/build.yml (+2 -2)
📝 Cargo.toml (+3 -0)
📝 docs/Compiling.md (+2 -0)
src/clients/upower/client.rs (+144 -0)
📝 src/clients/upower/mod.rs (+51 -76)
src/clients/upower/test_client.rs (+110 -0)
📝 src/modules/battery.rs (+8 -83)
test-configs/battery.corn (+3 -0)

📄 Description

Abstracts the dbus proxy code behind client code to match other clients/modules.

Adds a client which can be used in place of the upower dbus client for testing the battery widget, including on devices with no battery.

This sends mock sends which fully cycles the battery every 20 seconds.

Can be enabled using --features battery.test


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/JakeStanger/ironbar/pull/1357 **Author:** [@JakeStanger](https://github.com/JakeStanger) **Created:** 1/31/2026 **Status:** ✅ Merged **Merged:** 2/1/2026 **Merged by:** [@JakeStanger](https://github.com/JakeStanger) **Base:** `master` ← **Head:** `refactor/battery2` --- ### 📝 Commits (4) - [`b769b81`](https://github.com/JakeStanger/ironbar/commit/b769b81893041e5e444b8270758f29653b7364d4) refactor(battery): fully move client code to `clients/upower` - [`d0ddd51`](https://github.com/JakeStanger/ironbar/commit/d0ddd51f0026632e7838628de34c66f5a31ea861) test(battery): add mock client - [`ed98bf7`](https://github.com/JakeStanger/ironbar/commit/ed98bf770cda77220772208661afeafaf54c81e8) ci: fix incorrect `warnings` flag - [`6f5f228`](https://github.com/JakeStanger/ironbar/commit/6f5f2285d7e66e8dd00d7dcf330208c02ab037c5) ci(build): allow unused macros in feature checks ### 📊 Changes **8 files changed** (+323 additions, -161 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/build.yml` (+2 -2) 📝 `Cargo.toml` (+3 -0) 📝 `docs/Compiling.md` (+2 -0) ➕ `src/clients/upower/client.rs` (+144 -0) 📝 `src/clients/upower/mod.rs` (+51 -76) ➕ `src/clients/upower/test_client.rs` (+110 -0) 📝 `src/modules/battery.rs` (+8 -83) ➕ `test-configs/battery.corn` (+3 -0) </details> ### 📄 Description Abstracts the dbus proxy code behind client code to match other clients/modules. Adds a client which can be used in place of the upower dbus client for testing the battery widget, including on devices with no battery. This sends mock sends which fully cycles the battery every 20 seconds. Can be enabled using `--features battery.test` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
JakeStanger 2026-05-22 21:56:15 +01:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
JakeStanger/ironbar#1325
No description provided.