{ "info": { "author": "Herb Peyerl", "author_email": "hpeyerl+wave@beer.org", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5" ], "description": "# Get Readings from an Airthings Wave and publish to MQTT server\n\n[Airthings](http://airthings.com) makes a BTLE Radon detector called \"Wave\". This is an executable intended to be called periodically from Cron or some other scheduler to publish readings to an MQTT server.\n\n## Limitations\n\nThis application doesn't implement 'find' as provided in the example at https://airthings.com/raspberry-pi/\n\n## API\n\n```Python\nclass AirthingsWave:\n def __init__(self, config_file):\n```\n\nClass instantiation requires a path to a config file in YAML format.\n\n```\nmqtt:\n broker: 192.168.30.18\n port: 1883\n\nwaves:\n - name: \"basement-radon\"\n addr: 98:07:2d:43:4d:ff\n```\n\nBefore taking a reading, you should:\n\n```\n def ble_connect(self, addr):\n```\n\nThen you can:\n\n```\n def get_readings(self, p):\n def publish_readings(self, name, readings):\n```\n\n## Example\n\nFrom __main__.py:\n```python\n c = sys.argv[1]\n\n atw=airthingswave.AirthingsWave_mqtt(c)\n\n count=len(atw.waves)\n if count > 0:\n iter=0\n while iter