Skip to content

Bootstrap Rust crate with named power profile store - #1

Draft
NeroReflex with Copilot wants to merge 2 commits into
mainfrom
copilot/open-hardware-controller
Draft

NeroReflex with Copilot wants to merge 2 commits into
mainfrom
copilot/open-hardware-controller

Conversation

Copilot AI commented Nov 4, 2026 •

Copy link
Copy Markdown

The issue describes open-hardware-controller, a Rust successor to asusd/asusctl. It would manage LEDs, firmware attributes, power and fans, and expose ppd/tuned interfaces. It also calls for saving and restoring named power profiles and falling back to defaults when settings are managed by another tool. The repo was empty, so this PR adds the crate and implements only the profile piece. No hardware access is implemented yet.

  • Crate scaffold

    • Library crate open-hardware-controller with serde and serde_json as dependencies.
    • The async/zbus stack is not included yet.
  • Profile model (src/lib.rs)

    • PowerProfile holds an EPP policy, powercap limits in µW keyed by constraint name, and a fan curve.
    • ProfileStore keeps named profiles and one active profile. It has save, activate (returns None for an unknown name) and effective.
    • save_to_file and load_from_file persist the store as JSON.
  • External-management fallback

    • set_externally_managed(true) makes effective() return PowerProfile::default() while keeping the saved profiles and the active selection.
    • activate clears the externally-managed flag again.
let mut s = ProfileStore::default();
s.save("quiet", profile);
s.activate("quiet");
s.set_externally_managed(true);
assert_eq!(s.effective(), PowerProfile::default());
  • README

    • Adds a roadmap for the rest of the issue: dynamic LEDs, fwupd firmware attributes, pstate/powercap/fan/asus-armoury control, and a ppd/tuned D-Bus interface. None of these are implemented.
  • Review notes

    • Cargo.lock is committed.
    • PowerProfile::default() is a placeholder: balance-performance EPP, no powercap limits, no fan curve. Whether that is the right "default" once real hardware is wired in needs to be decided.
    • externally_managed is stored in the persisted JSON. This may not be what we want, since it describes runtime state.
Original prompt

open hardware controller

Is the evolution of asusd+asusctl (still in rust) and it features a much improved kernel integration and less reliance on userspace raw hardware access.

The base is similar to asusd/asusctl but with more async code and the latest version of zbus.

Uses the dynamic led interface OpenGamingCollective/linux-unstable#17 to control LEDs of all kernel-supported devices, not just limited to asus devices.

It uses fwupg to change firmware-attributes instead of raw access but firmware-attributes needs to be white-listed and classified manually to present a coherent interface
(no big list of uncategorized stuff).

The power management has to be fully controllable: amd-pstate, intel-pstate with epp policies, powercap limits, fan curves and obviously asus-armoury on top of that.

It must be able to do what ppd+powerd, thermald and PowerStation does in addition to what asusd already handles as it has to replace
all those tools at once.

It will need to expose a fully working ppd/tuned interface to integrate with existing software and it must not miss any feature of those to avoid huge failures.

It has to be able to save and respore named power profiles, and return to default ones when settings are externally managed to avoid cross-talking with other tools.

Co-authored-by: NeroReflex <3501105+NeroReflex@users.noreply.github.com>
Copilot AI changed the title [WIP] Implement improved hardware controller with dynamic LED interface Bootstrap Rust crate with named power profile store Nov 4, 2026
Copilot AI requested a review from NeroReflex November 4, 2026 17:41
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