Metadata-Version: 2.1
Name: myPyllant
Version: 0.0.4
Summary: A Python library to interact with the API behind the myVAILLANT app
Project-URL: Homepage, https://github.com/signalkraft/myPyllant
Project-URL: Bug Tracker, https://github.com/signalkraft/myPyllant/issues
Author-email: Philipp <pd@signalkraft.com>
License-File: LICENSE
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.7
Requires-Dist: aiohttp>=3.8.0
Requires-Dist: pydantic>=1.10.0
Description-Content-Type: text/markdown

# myPyllant

![myPyllant](https://raw.githubusercontent.com/signalkraft/myPyllant/main/logo.png)

A Python library to interact with the API behind the myVAILLANT app.

## Install and test

```shell
pip install myPyllant
python3 -m myPyllant.export username password (--data)
```
The `--data` argument exports historical data of the devices in your system.
Without this keyword, information about your system will be exported as JSON.

## Samples

```python
import argparse
import asyncio
from datetime import datetime, timedelta

from myPyllant.session import login, get_session
from myPyllant.services import get_systems, set_holiday, cancel_holiday, boost_domestic_hot_water, cancel_quick_veto_zone_temperature, cancel_hot_water_boost, set_domestic_hot_water_temperature, set_set_back_temperature, quick_veto_zone_temperature


parser = argparse.ArgumentParser(description='Export data from myVaillant API   .')
parser.add_argument('user', help='Username (email address) for the myVaillant app')
parser.add_argument('password', help='Password for the myVaillant app')


async def main(user, password):
    try:
        await login(user, password)
        async for system in get_systems():
            print(await set_holiday(system, datetime.now()))
            print(await set_holiday(system, datetime.now(), datetime.now() + timedelta(days=1)))
            print(await cancel_holiday(system))
            print(await boost_domestic_hot_water(system.domestic_hot_water[0]))
            print(await cancel_hot_water_boost(system.domestic_hot_water[0]))
            print(await set_domestic_hot_water_temperature(system.domestic_hot_water[0], 46))
            print(await set_set_back_temperature(system.zones[0], 15.5))
            print(await quick_veto_zone_temperature(system.zones[0], 21, 5))
            print(await cancel_quick_veto_zone_temperature(system.zones[0]))
    finally:
        await get_session().close()


if __name__ == "__main__":
    args = parser.parse_args()
    asyncio.run(main(args.user, args.password))

```