Python wrapper for getting air quality data from Nettigo Air Monitor devices.
Project description
nettigo-air-monitor
Python wrapper for getting air quality data from Nettigo Air Monitor devices.
How to use package
import asyncio
import logging
import async_timeout
from aiohttp import ClientError, ClientSession
from nettigo_air_monitor import ApiError, InvalidSensorData, NettigoAirMonitor
HOST = "192.168.172.12"
logging.basicConfig(level=logging.DEBUG)
async def main():
try:
async with ClientSession() as websession, async_timeout.timeout(30):
nam = NettigoAirMonitor(websession, HOST)
data = await nam.async_update()
mac = await nam.async_get_mac_address()
except (
asyncio.exceptions.TimeoutError,
ApiError,
ClientError,
InvalidSensorData,
) as error:
print(f"Error: {error}")
else:
print(f"Firmware: {nam.software_version}")
print(f"MAC address: {mac}")
print(f"Data: {data}")
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
loop.close()
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
Close
Hashes for nettigo_air_monitor-1.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b4d6b190b5618e070415feab3da71775e7f17ee6b4c1a1ec2128530dad2afc7 |
|
MD5 | 5fb42d4ea348053c87e69937f20298d2 |
|
BLAKE2b-256 | 85bf8f7d27beb3210e3f59377169079c84f54df8f3ad6e9a2b2e9b4130269c15 |
Close
Hashes for nettigo_air_monitor-1.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fac134a64919fab3e4cba63d0db8767d6ab8907b54a2a0aa1808b0de08e0e33e |
|
MD5 | b5b8eecd97041ffae4fe79d84847158e |
|
BLAKE2b-256 | dda82e464e9ebb9362032a8526510d4f12b70100a4fb7406717a703a4226f53c |