Skip to content

feat: Add fan plugin system #4272

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

feat: Add fan plugin system #4272

wants to merge 2 commits into from

Conversation

shadow3aaa
Copy link

Introduces a fan plugin system allowing users to control fan speeds with custom Lua scripts. This provides a more flexible alternative to static fan curves.

  • Adds UI controls to enable and select fan plugins under the "Fans + Power" tab.
  • Implements FanPluginManager for loading, managing, and executing Lua plugins.
  • Integrates plugin execution into the main application loop.
  • Adds default.lua (Simple PID controller) as example plugins.
  • Creates documentation (EN/ZH-CN) explaining how to use and create plugins.
  • Increases sensor refresh rate to 100ms for more responsive control.

Introduces a fan plugin system allowing users to control fan speeds with custom Lua scripts. This provides a more flexible alternative to static fan curves.

- Adds UI controls to enable and select fan plugins under the "Fans + Power" tab.
- Implements `FanPluginManager` for loading, managing, and executing Lua plugins.
- Integrates plugin execution into the main application loop.
- Adds `default.lua` (Simple PID controller) as example plugins.
- Creates documentation (EN/ZH-CN) explaining how to use and create plugins.
- Increases sensor refresh rate to 100ms for more responsive control.
@shadow3aaa
Copy link
Author

image

@seerge
Copy link
Owner

seerge commented Jun 30, 2025

@shadow3aaa hello, thanks for a contribution. But I didn't get it. How exactly are you planning to control fans ? If you want manual fan control - it's already possible with an experimental build

Mainstream app relies only on standard fiemware fan control (i.e. same as Armoury Crate offers) along all defaults or custom fan curves.

@shadow3aaa
Copy link
Author

@shadow3aaa hello, thanks for a contribution. But I didn't get it. How exactly are you planning to control fans ? If you want manual fan control - it's already possible with an experimental build

Mainstream app relies only on standard fiemware fan control (i.e. same as Armoury Crate offers) along all defaults or custom fan curves.

Well, I'm just tired of manually adjusting the temperature curve and want to solve it with a control algorithm.

The sensor polling timer was previously tied to the main window's visibility. This was an intentional power-saving feature, stopping background activity when the application was minimized to the tray.

However, the introduction of the fan plugin system requires continuous sensor data polling to allow plugins to manage fan speeds dynamically, even when the main window is not visible.

This change decouples the sensorTimer from the window's visibility state, allowing it to run persistently in the background. This ensures that fan plugins and other background monitoring tasks function correctly at all times.
@shadow3aaa
Copy link
Author

@shadow3aaa hello, thanks for a contribution. But I didn't get it. How exactly are you planning to control fans ? If you want manual fan control - it's already possible with an experimental build

Mainstream app relies only on standard fiemware fan control (i.e. same as Armoury Crate offers) along all defaults or custom fan curves.

Moreover, it's more reasonable compared to using the temperature curve. What the fan actually does is find a speed that just offsets the rate of heat generation, while the temperature itself doesn't directly correspond to the rate of heat generation. This approach minimizes fan noise while still ensuring effective cooling.

@seerge
Copy link
Owner

seerge commented Jul 4, 2025

@shadow3aaa hello, you seem to just spam a flat custom fan curve all the time ? That simply won't work for most of the models, as fan control still remains under firmware and usually it reacts even on a new custom fan curve with a huge delays. This is not a manual fan control.

You can use it for yourself of course, if you like it :)

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