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

"""An example of using Nettigo Air Monitor package."""
import asyncio
import logging

from aiohttp import ClientConnectorError, ClientError, ClientSession

from nettigo_air_monitor import (
    ApiError,
    AuthFailedError,
    ConnectionOptions,
    InvalidSensorDataError,
    NettigoAirMonitor,
)

logging.basicConfig(level=logging.DEBUG)

HOST = "nam"
USERNAME = "user"
PASSWORD = "password"


async def main():
    """Run main function."""
    options = ConnectionOptions(host=HOST, username=USERNAME, password=PASSWORD)

    async with ClientSession() as websession:
        nam = await NettigoAirMonitor.create(websession, options)

        try:
            data = await nam.async_update()
            mac = await nam.async_get_mac_address()
        except (
            ApiError,
            AuthFailedError,
            ClientConnectorError,
            ClientError,
            InvalidSensorDataError,
            asyncio.TimeoutError,
        ) as error:
            print(f"Error: {error}")
        else:
            print(f"Auth enabled: {nam.auth_enabled}")
            print(f"Firmware: {nam.software_version}")
            print(f"MAC address: {mac}")
            print(f"Data: {data}")


loop = asyncio.new_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-3.0.0.tar.gz (12.1 kB view details)

Uploaded Source

Built Distribution

nettigo_air_monitor-3.0.0-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nettigo_air_monitor-3.0.0.tar.gz
  • Upload date:
  • Size: 12.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for nettigo_air_monitor-3.0.0.tar.gz
Algorithm Hash digest
SHA256 8e4b83020572d79a22df17c7de04158e616f335babef9a7c568dc5e77118972c
MD5 8ba2717355993896a94f5bff0cb6f52c
BLAKE2b-256 ab69483bb9a041f85d5ffb304b547dad91f068cd33d1a56d55cf0719a3e03b5e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nettigo_air_monitor-3.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ccf95afa10c7c44a5560d1e0588119655f43fedfb21c8df58cdce12880881f40
MD5 4ed286bae4f979d15bbda16f1afad473
BLAKE2b-256 1cbcb089b725d2b4140769991927d106e1c86965751bf80971f2b5bf32ab6a2d

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