Metadata-Version: 2.4
Name: wave-reader
Version: 2.0.0
Summary: Unofficial package for Airthings Wave communication.
License: MIT
License-File: LICENSE.md
Author: Zackary Troop
Requires-Python: >=3.7.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Dist: Authlib (>=0.15.6)
Requires-Dist: attrs (>=21.3.0)
Requires-Dist: bleak (>=0.19.0)
Requires-Dist: httpx (>=0.18.2)
Requires-Dist: python-dateutil (>=2.8.2)
Project-URL: Homepage, https://github.com/ztroop/wave-reader-utils
Description-Content-Type: text/markdown

![Build Status](https://github.com/ztroop/wave-reader/workflows/Build%20Status/badge.svg)
[![PyPI Version](https://badge.fury.io/py/wave-reader.svg)](https://badge.fury.io/py/wave-reader)
[![PyPI Downloads](https://img.shields.io/pypi/dm/wave-reader)](https://pypi.org/project/wave-reader/)

**This package is currently in maintenance mode. Please use [airthings-ble](https://github.com/Airthings/airthings-ble) for new projects.**

## Wave Reader Utilities

The `Airthings Wave` is a series of devices that track Radon levels in the home. Radon is a radioactive
gas that comes from the breakdown of uranium in soil and rock. It's invisible, odourless and tasteless.

This is an **unofficial** Airthings Wave community library designed to provide utilities for device
communication.

## Features

- Using `bleak` as a dependency for platform cross-compatibility and support for asynchronous operation.
- Support for major models: Wave+, Wave, Wave (Version 2) and Wave Mini devices. View Plus is not supported, as it sends data over WiFi, not BTLE.
- Code testing, coverage reporting, linting, type hinting, and formatting.
- Provide a more comprehensive programming interface for a developer audience.


## Requirements

In Ubuntu/Debian, make sure you have `libglib2.0-dev` and `bluez` installed:

```sh
sudo apt-get install libglib2.0-dev bluez -y
```

Other Linux distributions should have equivalent packages. 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:

```sh
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.

```python
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.new_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 ...
```

> **Note:** The `wave_reader/web` module has been removed. It relied on an external API that we do not control and cannot guarantee works anymore.

## Contribution

If you identify a bug, please open a ticket. Pull requests are always welcome.

## Testing

You can run the entire test suite by running `make test`. It will run `flake8`, `mypy` and `pytest`.
If you'd like to just run unit tests, running `poetry run pytest ./tests` is sufficient.

