Skip to main content

CI codecov 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.

Sensor.Community firmware is also supported.

How to use package

"""An example of using Nettigo Air Monitor package."""

import asyncio
import logging

from aiohttp import ClientConnectorError, ClientError, ClientSession
from tenacity import RetryError

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

logging.basicConfig(level=logging.DEBUG)

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


async def main() -> None:
    """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()
        except (
            TimeoutError,
            ApiError,
            AuthFailedError,
            ClientConnectorError,
            ClientError,
            InvalidSensorDataError,
            RetryError,
        ) as error:
            print(f"Error: {error}")
        else:
            print(f"Firmware: {nam.software_version}")
            print(f"MAC address: {nam.mac}")
            print(f"Latitude: {nam.latitude}, Longitude: {nam.longitude}")
            print(f"Data: {data}")


loop = asyncio.new_event_loop()
loop.run_until_complete(main())
loop.close()

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

How to create a dev environment

git clone https://github.com/bieniu/nettigo-air-monitor.git
cd nettigo-air-monitor
./scripts/setup-local-env.sh

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-5.1.0.tar.gz (13.0 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-5.1.0-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nettigo_air_monitor-5.1.0.tar.gz
  • Upload date:
  • Size: 13.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for nettigo_air_monitor-5.1.0.tar.gz
Algorithm Hash digest
SHA256 000ace2c2f4dbb623a0cb28325a197b9684c6b95363bd52e422f2a5398526c20
MD5 d783c844717554515626117bfd48559f
BLAKE2b-256 9fabe951ec5b79127805ef7abbba36a246c4ec18e1c9f2d8d2563b8dae9b8697

See more details on using hashes here.

Provenance

The following attestation bundles were made for nettigo_air_monitor-5.1.0.tar.gz:

Publisher: publish.yml on bieniu/nettigo-air-monitor

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

File hashes

Hashes for nettigo_air_monitor-5.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 87b1ccd663218eecd8c79aaeed95e72023e8f0d33cbe97d0cee14a7751307f3a
MD5 38e99c9b3587835ab60c1682f23273dd
BLAKE2b-256 b2346e43661edceab97f936c679c8a1c031e9ec1b0063038934916a6e21d6e29

See more details on using hashes here.

Provenance

The following attestation bundles were made for nettigo_air_monitor-5.1.0-py3-none-any.whl:

Publisher: publish.yml on bieniu/nettigo-air-monitor

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

5.1.0 This release

2 files

5.0.0

2 files

4.1.0

2 files

4.0.0

2 files

3.3.0

2 files

3.2.0

2 files

3.1.0

2 files

3.0.1

2 files

3.0.0

2 files

2.2.2

2 files

2.2.1

2 files

2.2.0

2 files

2.1.0

2 files

2.0.0

2 files

1.6.0

2 files

1.5.0

2 files

1.4.2

2 files

1.4.1

2 files

1.4.0

2 files

1.3.0

2 files

1.2.4

2 files

1.2.3

2 files

1.2.2

2 files

1.2.1

2 files

1.2.0

2 files

1.1.1

2 files

1.1.0

2 files

1.0.0

2 files

0.2.6

2 files

0.2.5

2 files

0.2.4

2 files

0.2.3

2 files

Supported by

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