Unofficial package for Airthings Wave communication.
Project description
Summary
This is an unofficial Airthings Wave library designed to provide tools and information around device communication. The library wouldn't be possible without the existing scripts available by Airthings and contribution of others. See documentation for more information.
This library uses bleak
as a dependency instead of bluepy
for platform cross-compatibility
and support for asynchronous operation.
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.
- Support other devices like Wave (Version 1).
- Add View Plus support.
- Add battery life support.
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. That includes
CLI interaction and other interesting scenarios that demonstrate API usage.
import asyncio
from wave_reader import wave
if __name__ == "__main__":
# Scan for BTLE Wave devices.
devices = wave.scan()
# Event loop to run asynchronous tasks.
loop = asyncio.get_event_loop()
# Get sensor readings from available wave devices.
for d in devices:
sensor_readings = loop.run_until_complete(d.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.
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
Hashes for wave_reader-0.0.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c31a9fcaf24d31c23d3b884c993843e9b2fd92c7f658f8a390c23fe9d59f8eec |
|
MD5 | 8d7745072fd9aadfa22f454cfdb148da |
|
BLAKE2b-256 | e8b5b6fd7391e4e1a0d63b589cfc35fe2954d75fac0919943663859cc04737e1 |