Skip to content
/ aosong Public

AOSONG Sensors Python 3 package. Currently only supports the AM2315 temperature and humidity sensor.

License

Notifications You must be signed in to change notification settings

roder/aosong

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AOSONG Sensors

Python package that provides support for AOSONG Sensor.

This package and it's modules have been organized to support additional AOSONG sensors. It currently only supports the AM2315 Temperature and Humidity Sensor. Additional sensors are encouraged and welcomed. Please submit a Pull Request.

The original author of this library was Sopwith. This repository was originally forked from the code provided by the author on their blog. The purpose of the repository is to provide a pythonic library that can be installed with pip and setuptools.

Requirements

Installation

Recommended

pip install --process-dependency-links aosong

Manual

python setup.py install

Usage

>>> from aosong import am2315
>>> sensor = am2315.Sensor()
>>> sensor.temperature()
19.1
>>> sensor.celsius()
19.1
>>> sensor.fahrenheit()
66.3
>>> sensor.temperature(True)
66.3
>>> sensor.humidity()
70.1
>>> sensor.data()
(70.0, 19.1, 66.3)
>>>

Sensor.data()

Sensor.data() returns a tuple containing three values.

(41.8, 23.5, 74.3)

The first value is the current relative humidity The second value is the current temperature in Celsius. The third value is the current temperature in Fahrenheit.

Sensor.temperature()

Sensor.temperature() returns the current temperature in Celsius.

If you want the current temperature returned in Fahrenheit pass True as a parameter.

sensor.temperature(True)

Test script:

am2315.py is a unittest script you should run to ensure your sensor is wired correctly. If it is, you should see the below test results.

python setup.py test

Support and Contribution

Pull requests and Issues are welcome!

Otherwise, please feel free to report bugs, comments, enhancement requests to: sopwith@ismellsmoke.net http://sopwith.ismellsmoke.net

About

AOSONG Sensors Python 3 package. Currently only supports the AM2315 temperature and humidity sensor.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages