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 Revolut.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-4.1.0.tar.gz (13.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nettigo_air_monitor-4.1.0-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nettigo_air_monitor-4.1.0.tar.gz
  • Upload date:
  • Size: 13.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for nettigo_air_monitor-4.1.0.tar.gz
Algorithm Hash digest
SHA256 4ce23147163739391611cda3e1a7f54ec96920de9f1c923dff44f493810e9be1
MD5 131f72fb872b36e4d9f557c14680894e
BLAKE2b-256 fe0ce7a3b608abf20549355731659c133b80909f75f87ea77fc1a4ddab6aea37

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nettigo_air_monitor-4.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 080292a36b9dc4b851c5363d4a8958a5a1f332e53ae497f26fb269769b164dda
MD5 9094b1d96f21cc739b8bb561a7f86fac
BLAKE2b-256 16829dc4d6b725b4f806f13f4176c6fa9c9dc612b2b6d0f3174d49e623aa2de0

See more details on using hashes here.

Supported by

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