-
-
Notifications
You must be signed in to change notification settings - Fork 463
Plugins
Fan Control supports plugins to inject sensors and controls into the software from external sources.
Example: https://github.com/Rem0o/FanControl.DellPlugin and https://github.com/Rem0o/FanControl.HWInfo
- .NET assembly (dll) named FanControl.[YourPluginName].dll
- Reference FanControl.Plugins.dll from https://github.com/Rem0o/FanControl.Releases/blob/master/FanControl.zip
- Implement the interface IPlugin OR IPlugin2
- Drop your dll into the Plugins folder of FanControl. At startup, it will find IPlugins implementations by reflection.
You must implement the interface with the following members:
- Name ( string )
- Initialize()
- Load( container )
- Close()
The life-cycle of the plugin is as follow:
Initialize => Load => Close.
These methods should be able to be called in this order any number of times without any side-effect or undisposed resources.
The load method gets passed a "container" object which contains different lists for your sensors to be added.
You may (optional) inject the following in your plugin's constructor:
- IPluginDialog: Let you invoke a message dialog to the user
- IPluginLogger: Let you write in the error log file.
New implementation that inherits IPlugin and adds
- Update()
Use this method if you want a single hook to update all your sensors from a single method instead of updating from every sensor.
A sensor has the following members
- Id
- Name
- Value
- Update()
The Update method is called internally by the FanControl backend every update cycle, which right now is 1 Hz. Update the value of your sensor in that method from whatever source you are using.
A control sensor controls sets a value to a fan ( or whatever else ) from a fan curve. That value is between 0 and 100.
A sensor has the following methods
- Set( val )
- Reset()
The Set( val ) method should activate your control and apply the value to it. The Reset() method is called when the control is disabled and should return back to its default state.