
[![License](https://img.shields.io/github/license/mausy5043/pylywsdxx-async)](LICENSE)
[![PyPI version](https://img.shields.io/pypi/v/pylywsdxx-async.svg?logo=pypi&logoColor=FFE873)](https://pypi.org/project/pylywsdxx-async)
[![Supported Python versions](https://img.shields.io/pypi/pyversions/pylywsdxx-async.svg?logo=python&logoColor=FFE873)](https://pypi.org/project/pylywsdxx-async)
[![PyPI downloads](https://img.shields.io/pypi/dm/pylywsdxx-async.svg)](https://pypistats.org/packages/pylywsdxx-async)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/Mausy5043/pylywsdxx-async/devel.svg)](https://results.pre-commit.ci/latest/github/Mausy5043/pylywsdxx-async/devel)

# pylywsdxx-async

This is a Python3 library to allow asynchronous interrogation of Xiaomi Mijia LYWSD* sensors via Bluetooth Low Energy (BLE).

**Note**: This is an unofficial project, and is in no way supported or endorsed by Xiaomi.

## Requirements

Development of this package is done in Python 3.12. The package is considered forwards compatible at least upto Python 3.12 and probably also beyond. Backwards compatibility is not guaranteed; if it works on Python 3.9 or before consider yourself lucky. [Python versions that are end-of-life](https://devguide.python.org/versions/) are not supported.

The package has been extensively tested on a Raspberry Pi 3 Model B+ (aarch64) with Debian GNU Linux 12 /w Python 3.11.*.


## Installation

```
pip install pylywsdxx-async
```

## Usage
**Under construction**
```
import pylywsdxx-async as pyly

mac = "A4:C1:38:0D:EA:D0"

device2 = pyly.Lywsd02(mac)
data2 = device2.data
print(f"Temperature: {data2.temperature}˚C")

device3 = pyly.Lywsd03(mac)
data3 = device3.data
print(f"Temperature: {data3.temperature}˚C")
```


## Disclaimer & License
`pylywsdxx-async` is distributed under [AGPL-3.0-or-later](LICENSE). We make no promises whatsoever.See LICENSE for details.
