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-2.2.2.tar.gz (12.7 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: nettigo_air_monitor-2.2.2.tar.gz
  • Upload date:
  • Size: 12.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.0

File hashes

Hashes for nettigo_air_monitor-2.2.2.tar.gz
Algorithm Hash digest
SHA256 81b77e016655c12a3e18a5c72f4a471894ae0c1d7fb786ba0b8722f51e3a61cc
MD5 e8d490be293691196bbc4b512491f9e6
BLAKE2b-256 c8d11db60be511b79241aee63177284f507ef3ae12c1ba3510e4bee3141ff69f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nettigo_air_monitor-2.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a55467cf205024958155848ebba62fd2b11486059c60cdea0d51a9bd464d624b
MD5 7f47037aab2e50fcb598f255ecac2aec
BLAKE2b-256 a2b7d9016c1c70bbc9688c7748d3223f7a0858175824eba11bc52773043ab4fe

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