Skip to content

WIP: Add fan profiles, localization, tests, RGB routing, and Nitro monitor - #205

Draft
scherenhaenden wants to merge 12 commits into
PXDiv:mainfrom
scherenhaenden:feature/rgb-csharp-routing
Draft

WIP: Add fan profiles, localization, tests, RGB routing, and Nitro monitor#205
scherenhaenden wants to merge 12 commits into
PXDiv:mainfrom
scherenhaenden:feature/rgb-csharp-routing

Conversation

@scherenhaenden

@scherenhaenden scherenhaenden commented Jun 19, 2026

Copy link
Copy Markdown

Status: Work in progress. This PR is not ready to merge yet; there are still follow-up fixes and validations pending.

Preamble / Change Index

This PR grew from several related changes that were made in a deliberate order:

  1. Modularize the existing code first. The dashboard code-behind had become too large to work on comfortably, so the first step was splitting it into smaller partial files by responsibility. That makes the rest of the changes easier to review and maintain.
  2. Add tests before leaning further into feature work. A dedicated NUnit test project was added so the project has some reliability coverage around the new model/storage/helper logic. The goal is to make future changes less risky and easier to validate.
  3. Add the fan profile feature. This introduces a dedicated fan profile page, persistent profiles, and an editable curve graph for temperature-to-fan-percentage behavior.
  4. Improve UI maintainability. Localization support was added to start removing hard-coded UI strings and make future UI changes cleaner.
  5. Clean up RGB routing on the C# side. Static RGB and dynamic RGB effects now go through clearer request-mapping logic without requiring a daemon protocol change.
  6. Document the larger RGB direction. The proposed daemon-side set_extended_rgb command is documented as future work, but it is not implemented here.
  7. Add comments/documentation. XML and inline comments were added after the functional work to make the changed code easier to understand during review and future maintenance.

In short: this PR is not only a documentation PR. It includes refactoring, tests, new UI features, localization groundwork, C# RGB routing cleanup, daemon-side Nitro/PredatorSense button monitoring changes, and documentation.


Summary

This PR is not documentation-only. It is a broad feature and cleanup branch on top of main that adds fan profile management, modularizes the dashboard code-behind, introduces localization support, adds a unit test project, improves keyboard RGB routing in the C# GUI, and enables Nitro/PredatorSense button monitoring in the daemon.

Compared with main, the PR currently changes 38 files with roughly 5,398 additions and 1,712 deletions.

Main Changes

Project modernization

  • Moves the Avalonia client from net9.0 to net10.0.
  • Updates Avalonia packages to 11.3.17.
  • Updates LiveChartsCore packages to 2.0.4.
  • Updates Material icon packages where applicable.
  • Adds the test project to DivAcerManagerMax.sln.
  • Expands .gitignore for bin/, obj/, publish folders, build/dist outputs, IDE files, env files, and test results.

Dashboard modularization

  • Splits the large Dashboard.axaml.cs implementation into partial files:
    • Dashboard.Animations.cs
    • Dashboard.Charts.cs
    • Dashboard.Fans.cs
    • Dashboard.Metrics.cs
    • Dashboard.SystemInfo.cs
  • Keeps the dashboard behavior grouped by responsibility: metrics, fan speed discovery, system info, chart setup, and fan animation updates.

Fan profiles

  • Adds a new Fan Profiles tab to the main UI.
  • Adds FanProfile, FanCurvePoint, and FanProfileStorage models/storage.
  • Adds FanProfiles.axaml and FanProfiles.axaml.cs for profile management.
  • Adds FanCurveEditor, an interactive temperature-to-fan-percentage graph:
    • drag existing points,
    • click empty graph space to add a point,
    • keep points sorted by temperature,
    • show the active point values while editing.
  • Saves profiles locally and applies the selected curve through the existing daemon fan speed command path.

Fan control behavior

  • The fan profile page now follows the same available fan control path used by Power & Performance.
  • Applying a profile uses the selected target (All Fans, CPU Fan, GPU Fan) and sends manual percentages through the existing SetFanSpeedAsync flow.

Localization

  • Adds LocalizationManager and a language selector.
  • Tags many existing UI strings with loc: keys.
  • Adds initial support for English, Spanish, German, Italian, Portuguese, and additional languages via fallback/merged dictionaries.
  • Persists the selected language under the user config directory.

Keyboard RGB routing

  • Adds RgbLightingMapper for GUI-side RGB request normalization.
  • Separates static zone-color handling from animated effect handling.
  • Static mode uses the existing set_per_zone_mode daemon command.
  • Dynamic modes use the existing set_four_zone_mode daemon command.
  • Fixes direction mapping from the UI into daemon values.
  • Adds RGB mapper unit tests.

RGB daemon planning docs

  • Adds rgb_extension_proposal.md with the broader RGB extension design.
  • Adds rgb_daemon_feature_plan.md for the future daemon-side set_extended_rgb command.
  • set_extended_rgb is planned only in this PR. It is not implemented in the daemon yet.
  • The current implementation intentionally relies on the daemon commands that already exist.

Nitro / PredatorSense button monitoring

  • Re-enables daemon import/use of KeyboardMonitor.
  • Adds configurable daemon settings for Nitro/PredatorSense button monitoring:
    • NitroButtonEnabled
    • NitroButtonKeycode
    • NitroButtonCommand
  • Starts/stops the keyboard monitor as part of daemon setup/shutdown.
  • Improves keyboard device selection by preferring the Acer WMI hotkeys device and falling back to a keyboard event device.
  • Uses the target user runtime directory for DBUS_SESSION_BUS_ADDRESS.

Unit tests

Adds DivAcerManagerMax.Tests with NUnit tests under units/ plus assets directories:

  • FanCurvePointTests
  • FanProfileTests
  • FanProfileStorageTests
  • RgbLightingMapperTests

Current test count: 15 tests.

Verification

Ran locally:

dotnet test DivAcerManagerMax.Tests/DivAcerManagerMax.Tests.csproj --no-restore

Result:

Passed: 15, Failed: 0, Skipped: 0, Total: 15

The build still emits existing C# warnings, mostly around nullability, event hiding, and async calls that are not awaited. Those warnings are not resolved by this PR.

Important Review Notes

  • This PR includes daemon changes in DAMM-Daemon/DAMX-Daemon.py and DAMM-Daemon/KeyboardMonitor.py; it is not C#-only overall.
  • This PR currently includes .idea/.idea.DivAcerManagerMax/.idea/workspace.xml. That is usually local IDE state and should be reviewed before merge.
  • The PR contains a later documentation/commenting commit that adds many XML comments and inline comments across the changed C# files. That is documentation added on top of the functional changes, not the full purpose of the PR.
  • Real hardware validation is still needed for fan profile application, RGB behavior, and Nitro/PredatorSense button monitoring.

Out of Scope

  • Implementing the daemon-side set_extended_rgb socket command.
  • Alternate driver abstraction such as facer.ko support.
  • Full hardware verification across multiple Acer models.
  • Cleaning up all existing nullable/event warnings.

@scherenhaenden scherenhaenden changed the title docs: add comprehensive comments to all C# classes, methods, and variables WIP: Add fan profiles, localization, tests, RGB routing, and Nitro monitor Jun 19, 2026
@scherenhaenden
scherenhaenden marked this pull request as draft June 19, 2026 12:33
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