Code Monkey home page Code Monkey logo

wave-reader-utils's Introduction

Build Status codecov PyPI version

This package is currently in maintenance mode. Please use 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 and web 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.
  • Auxillary module that provides a web client for Airthings API and OAuth2 authentication.

Requirements

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

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:

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

Web API Client Module

The wave_reader/web module in this library provides a client for the Airthings web API. See this page for more details.

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 tox. It will run flake8, isort and pytest. If you'd like to just run unit tests, running pytest ./tests is sufficient.

wave-reader-utils's People

Contributors

gitter-badger avatar jschornick avatar ztroop avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

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.