3. Command-line interface¶
fanctl
is a CLI allowing to interract with the server.
It is basically a fand client, but does not act as a fan controller.
The user can get the assigned fan speed in percentage, the real fan speed in rpm.
The user can override the assigned fan speed. The override can also be set to expire in a given amount of time, or expire at a given date and time.
3.1. Examples¶
Ping the server at 192.168.1.10:1234:
$ fanctl -a 192.168.1.10 -P 1234 ping
Get the assigned fan speed for shelf ‘shelf1’:
$ fanctl get-pwm shelf1
Override fan speed of ‘myshelf’ to 100%:
$ fanctl set-pwm-override myshelf 100
Remove override in 1 hour and 30 minutes:
$ fanctl set-pwm-expire-in myshelf 1h30m
Remove override now:
$ fanctl set-pwm-override myshelf none
3.2. Python API¶
-
fand.fanctl.
DATETIME_DATE_FORMATS
¶ List of accepted string formats for
datetime.datetime.strptime()
-
fand.fanctl.
DATETIME_DURATION_FORMATS
¶ List of accepted regex formats for
datetime.timedelta
-
fand.fanctl.
ACTION_DICT
¶ Dictionnary associating action strings to their corresponding functions
3.2.2. send¶
-
fand.fanctl.
send
(action: str, *args, address: str = 'build-11968335-project-622900-fand', port: int = 9999) → None[source]¶ Main function of this module
Parameters: - action – Action to call
- args – Arguments to send to the action
- address – Server address
- port – Server port
Raises: FanctlActionBadValue – Invalid action name or arguments