Unofficial package for Airthings Wave communication.
Project description
Summary
This is an unofficial Airthings Wave library designed to provide software developers a more developer-friendly library for BTLE handling for Airthings Wave devices. This library wouldn't be possible without the documentation and scripts available by Airthings. I hope to continue making updates through Airthings continued open-source contributions.
This library uses bleak as a dependency instead of bluepy for platform
cross-compatibility and support for asynchronous operation.
This project is currently in alpha state.
Goals
These are the goals for this project, in no particular order:
- Support platform cross-compatibility. Windows, Mac and Linux.
- Support WavePlus, Wave (Version 2) and Wave Mini devices.
- Support operation across multiple devices asynchronously.
- Code testing, linting, type hinting, formatting and coverage reporting.
- Discover all Wave devices or inherit WaveDevice class for sensor readings.
- Add battery life support.
- Implement reconnection logic for BTLE client.
- Support other devices like Wave (Version 1) and more.
Requirements
In Ubuntu Linux, make sure you have libglib2.0-dev and bluez installed:
sudo apt-get install libglib2.0-dev bluez -y
In theory, other platforms (Windows, Mac) are supported by using bleak as a dependency, but open a ticket if you run into any issues.
Installation
You can install the library by running:
pip install wave-reader
Example Usage
There are various concrete examples available in the examples directory. This includes
CLI interaction and other scnearios that demonstrate API usage.
import asyncio
from wave_reader import discover_devices
if __name__ == "__main__":
# Event loop to run asynchronous tasks.
loop = asyncio.get_event_loop()
# Scan for BTLE Wave devices.
devices = loop.run_until_complete(discover_devices())
# Get sensor readings from available wave devices.
for device in devices:
sensor_readings = loop.run_until_complete(device.get_sensor_values())
print(sensor_readings)
# >>> DeviceSensors (humidity: 32.5, radon_sta: 116, radon_lta: 113 ...
Testing
You can run the entire test suite by running tox. It will run flake8, isort and pytest.
If you'd like to just run unit tests, running pytest ./tests is sufficient.
Special Thanks
I'd like to thank Airthings for their open-source work and commitment to air quality. Radon and other air pollutants often go unnoticed, so knowledge (really) is power here.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file wave-reader-0.0.4.tar.gz.
File metadata
- Download URL: wave-reader-0.0.4.tar.gz
- Upload date:
- Size: 6.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.8.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
835e0988d03066caeeef60e5fea318b7a7d76ace26f9854b0fa3cdba7b77141c
|
|
| MD5 |
e26dd12435bc4bb26af91856c78736ba
|
|
| BLAKE2b-256 |
eaeda8fb8c2ae9b38b4c5c2f25ff24c0df502021375a52f5437224539c85fe8c
|
File details
Details for the file wave_reader-0.0.4-py3-none-any.whl.
File metadata
- Download URL: wave_reader-0.0.4-py3-none-any.whl
- Upload date:
- Size: 7.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.8.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
24a612a966f86a9272f3c951a3d85d63f514def7852a3a78e7953b6e840f1565
|
|
| MD5 |
954e0878eed47d0d3ed3251c652e7ac3
|
|
| BLAKE2b-256 |
eaf838f440e9cda9932e96aedce9e79fb2f52b49e5ae4585c9bda7f4497e1514
|