Skip to main content

Python wrapper for getting air quality data from Nettigo Air Monitor devices.

Project description

GitHub Release PyPI PyPI - Downloads Buy me a coffee PayPal_Me

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nettigo_air_monitor-1.2.1.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

nettigo_air_monitor-1.2.1-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

Details for the file nettigo_air_monitor-1.2.1.tar.gz.

File metadata

  • Download URL: nettigo_air_monitor-1.2.1.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

File hashes

Hashes for nettigo_air_monitor-1.2.1.tar.gz
Algorithm Hash digest
SHA256 06b11626f5a1538ac449c831c1fb1dd62d640b771f88c2cca089105a86e53b50
MD5 1c66f362c8592f06353b412c314cd7cc
BLAKE2b-256 1bb18e052a59ca574c5ec770f24db54e7f082e527c46788ee277e6cbf819d492

See more details on using hashes here.

File details

Details for the file nettigo_air_monitor-1.2.1-py3-none-any.whl.

File metadata

  • Download URL: nettigo_air_monitor-1.2.1-py3-none-any.whl
  • Upload date:
  • Size: 10.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

File hashes

Hashes for nettigo_air_monitor-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 709336d2db482535f20091d872787e06523a027a4e332dc1b044118df2bdff1f
MD5 495312307ce19c8a68b5e17d281fa176
BLAKE2b-256 2e3e015a951d0cbd1815707952cdaf84a0bed9e5c06672016125a6b53d3e5a57

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page