Metadata-Version: 2.1
Name: py-AHTx0
Version: 0.1.2
Summary: A library to drive a AHT10 or AHT20 temperature, humidity sensor over I²C
Home-page: https://github.com/4meters/py_AHTx0
Author: Kattni Rembor, Marcin Ryznar
Author-email: poczta321123@onet.pl
License: MIT
Keywords: raspberry pi,orange pi,banana pi,rpi,AHT10,AHT20,i2c,i²c,temperature,humidity,smbus2
Classifier: License :: OSI Approved :: MIT License
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: Developers
Classifier: Topic :: Education
Classifier: Topic :: System :: Hardware
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.6, <4
Description-Content-Type: text/x-rst
Provides-Extra: docs
Provides-Extra: qa
Provides-Extra: test
License-File: LICENSE

Introduction
============

Python library using smbus2 for the Adafruit AHT10 or AHT20 Humidity and Temperature Sensor

Based on original solution from Adafruit repo: https://github.com/adafruit/Adafruit_CircuitPython_AHTx0

Dependency lightweight

Dependencies
=============
This library depends on:

* smbus2

Installing from PyPI
=====================

On supported GNU/Linux systems like the Raspberry Pi, you can install the library locally `from
PyPI <https://pypi.org/project/py-AHTx0/>`_. To install for current user:

.. code-block:: shell

    pip3 install py_AHTx0

To install system-wide (this may be required in some cases):

.. code-block:: shell

    sudo pip3 install py_AHTx0

To install in a virtual environment in your current project:

.. code-block:: shell

    mkdir project-name && cd project-name
    python3 -m venv .venv
    source .venv/bin/activate
    pip3 install py_AHTx0

Usage Example
=============

.. code-block:: python3

    import py_AHTx0

    # aht10 - init
    port = 1
    address = 0x38

    aht10_sensor = py_AHTx0.AHTx0(port, address)

    while True:
        print(aht10_sensor.temperature)
        print(aht10_sensor.relative_humidity)
        time.sleep(2)


Documentation
=============


calibrate() → bool

    Ask the sensor to self-calibrate. Returns True on success, False otherwise

property relative_humidity: int

    The measured relative humidity in percent.

reset() → None

    Perform a soft-reset of the AHT

property status: int

    The status byte initially returned from the sensor, see datasheet for details

property temperature: int

    The measured temperature in degrees Celsius.
