Git Product home page Git Product logo

wave-reader-utils's Introduction

Build Status codecov PyPI version

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.
  • Support other devices like Wave (Version 1).
  • 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. 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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.