Metadata-Version: 2.1
Name: smsfan
Version: 1.2.0
Summary: A set of functions to control Sequent Microsystems Smart Fan card
Home-page: https://www.sequentmicrosystems.com
Author: Sequent Microsystems
Author-email: olcitu@gmail.com
License: MIT
Classifier: Development Status :: 3 - Alpha
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Build Tools
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Description-Content-Type: text/markdown
Provides-Extra: rpi5
License-File: LICENSE

[![sfan](../images/sequent.jpg)](https://www.sequentmicrosystems.com)

# sfan

This is the python library to control the [Smart Fan Card for Raspberry Pi](https://sequentmicrosystems.com/products/smart-fan-hat-for-raspberry-pi).


## Install

For **Raspberry Pi 5** only, run the folowing:
```bash
sudo pip install SMsfan[rpi5]
```

or

```bash
sudo pip install SMsfan
```

or

```bash
sudo pip3 install SMsfan
```

## Update

```bash
sudo pip install SMsfan -U
```

or

```bash
sudo pip3 install SMsfan -U
```

Now you can import the sfan library and use its functions. To test, read processor temperature from the Smart Fan with stack level 0:

```bash
~$ python
Python 2.7.9 (default, Sep 17 2016, 20:26:04)
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sfan
>>> sfan.getProcTemp(0)
31
>>>
```


## Functions

### setPower(stack, power)

Set the Smart Fan power

**stack** - stack level, set with jumper [0/1]

**power** - Fan power  [0..100]


### getPower(stack)

Return the fan power [0..100]

**stack** - stack level, set with jumper [0/1]


### setSafetyTemp(stack, temp):

Set the Smart Fan safety temperature. If fan processor temperature exceeds this value fan will run 100%

**stack** - stack level, set with jumper [0/1]

**tenp** - Safety temperature in degree Celsius  [30..80]


### getSafetyTemp(stack)

Return the fan safety temperature in degree Celsius [30..80]

**stack** - stack level, set with jumper [0/1]


### getProcTemp(stack)

Return the fan processor temperature in degree Celsius

**stack** - stack level, set with jumper [0/1]


### setLedBlink(stack, blink):

Turn the Smart Fan led blink on or off  

**stack** - stack level, set with jumper [0/1]

**blink** - Led blinking enable [0/1]


### getLedBlink(stack)

Return the fan led blinking [0/1]

**stack** - stack level, set with jumper [0/1]


### setStopInt(stack, seconds)

Set the stop interval in seconds. The fan will run 100% specified seconds then stop.

**stack** - stack level, set with jumper [0/1]

**seconds** - how long fan will run [1..65000]


### getStopInt(stack)

Return remaining time until fan will stop

**stack** - stack level, set with jumper [0/1]
