Skip to main content

AOSONG Sensors.

Project description

# 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](https://www.adafruit.com/datasheets/AM2315.pdf). Additional sensors are
encouraged and welcomed. Please submit a Pull Request.

The original author of this library was
[Sopwith](http://sopwith.ismellsmoke.net). This repository was originally forked
from the code provided by the author on [their
blog](http://sopwith.ismellsmoke.net/?p=104). The purpose of the repository is
to provide a pythonic library that can be installed with `pip` and `setuptools`.

## Requirements

* Python 3
* [Quick2wire Python API](https://github.com/quick2wire/quick2wire-python-api)

## Installation

### Recommended
```shell
pip install --process-dependency-links aosong
```

### Manual
`python setup.py install`

## Usage

```python
>>> 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](mailto:sopwith@ismellsmoke.net)
[http://sopwith.ismellsmoke.net](http://sopwith.ismellsmoke.net)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

aosong-0.0.2.tar.gz (4.7 kB view details)

Uploaded Source

aosong-0.0.2.macosx-10.9-x86_64.tar.gz (7.4 kB view details)

Uploaded Source

File details

Details for the file aosong-0.0.2.tar.gz.

File metadata

  • Download URL: aosong-0.0.2.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for aosong-0.0.2.tar.gz
Algorithm Hash digest
SHA256 fb324d71b4709c1bb1ff4b5108062c38f2d82f7e812422341d6baa1e9a66392d
MD5 3d69a0cc0b1dacf163becafb3e89be70
BLAKE2b-256 9eb1dfeb8407b02de9fa16c7bdf1494217299e5b7f7613d3dd35a194c7162757

See more details on using hashes here.

File details

Details for the file aosong-0.0.2.macosx-10.9-x86_64.tar.gz.

File metadata

File hashes

Hashes for aosong-0.0.2.macosx-10.9-x86_64.tar.gz
Algorithm Hash digest
SHA256 f8c05e2983d0d03b5aa778c4726879c1ddc5c8d33e085f9358d2a04aabf0d3a3
MD5 3e3499df433e000650b2f774950a08ca
BLAKE2b-256 36d24a5fe31a0f2c3dacd90c16e481ab223de0a0603b3e0939eee9156b37a588

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page