Metadata-Version: 2.1
Name: aircloudy
Version: 0.1.6
Summary: A library to pilot hitachi aircloud AC
Home-page: https://github.com/ylemoigne/aircloudy
Keywords: aircloud,SPX-WFG
Author: Yann Le Moigne
Author-email: ylemoigne@javatic.fr
Requires-Python: >=3.10,<4.0
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Dist: aiodns (>=3.1.1,<4.0.0)
Requires-Dist: aiohttp (>=3.9.3,<4.0.0)
Requires-Dist: pyjwt (>=2.8.0,<3.0.0)
Requires-Dist: tzlocal (>=5.2,<6.0)
Requires-Dist: websockets (>=12.0,<13.0)
Project-URL: Repository, https://github.com/ylemoigne/aircloudy
Description-Content-Type: text/markdown

# aircloudy

[![PyPI - Version](https://img.shields.io/pypi/v/aircloudy.svg)](https://pypi.org/project/aircloudy)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/aircloudy.svg)](https://pypi.org/project/aircloudy)

Aircloudy is an unofficial python library that allow management of RAC (Room Air Conditioner) compatible with Hitachi Air Cloud.

This project IS NOT endorsed by Hitachi and is distributed as-is without warranty.

-----

**Table of Contents**

- [Installation](#installation)
- [Usage](#usage)
- [License](#license)
- [Development](#development)

## Installation

```console
pip install aircloudy
```

## Usage

```python
from __future__ import annotations
import asyncio
from aircloudy import HitachiAirCloud, InteriorUnit, compute_interior_unit_diff_description


def print_changes(dict: dict[int, tuple[InteriorUnit|None, InteriorUnit|None]]) -> None:
    for (id, change) in dict.items():
        print(f"Change on interior unit {id}: "+compute_interior_unit_diff_description(change[0], change[1]))

async def main() -> None:
    async with HitachiAirCloud("your@email.com", "top_secret") as ac:
        ac.on_change = print_changes

        unit_bureau = next((iu for iu in ac.interior_units if iu.name == "Bureau"), None)
        if unit_bureau is None:
            raise Exception("No unit named `Bureau`")

        await ac.set(unit_bureau.id, "ON")
        await ac.set(unit_bureau.id, requested_temperature=21, fan_speed="LV3")

        await asyncio.sleep(30)


asyncio.run(main())
```

## License

`aircloudy` is distributed under modified HL3 license. See `LICENSE.txt`.

## Development

```console
poetry run task lint
```

```console
poetry run task check
```

```console
poetry run task test
```

```console
poetry run task coverage
```
