Skip to content

Plugins

Rem0o edited this page Feb 20, 2023 · 8 revisions

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

Requirements:

IPlugin

You must implement the interface with the following members:

  1. Name ( string )
  2. Initialize()
  3. Load( container )
  4. 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.

IPlugin2

New implementation that inherits IPlugin and adds

  1. 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.

IPluginSensor

A sensor has the following members

  1. Id
  2. Name
  3. Value
  4. 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.

IPluginControlSensor (inherits IPluginSensor)

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

  1. Set( val )
  2. 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.

Clone this wiki locally