Metadata-Version: 2.4
Name: blaubergvento_client
Version: 0.0.1
Summary: A client for communicating with Blauberg vento (and derived) ventilators.
Home-page: https://github.com/michaelkrog/blaubergvento-python
Author: Michael Krog
Author-email: Michael Krog <info@apaq.dk>
License: MIT License
        
        Copyright (c) 2022 Michael Krog
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/michaelkrog/blaubergvento-python
Keywords: blauberg,duka,ventilator
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: dev
Requires-Dist: black; extra == "dev"
Requires-Dist: bumpver; extra == "dev"
Requires-Dist: isort; extra == "dev"
Requires-Dist: pip-tools; extra == "dev"
Requires-Dist: pytest; extra == "dev"
Dynamic: author
Dynamic: home-page
Dynamic: license-file

# Introduction

This is a Python module for communicating with a Blauberg Vento (and OEMS like Duka One S6w).
The Blauberg Vento is a one room ventilationsystem with a heat exchanger.

This module has roots in the [dukaonesdk](https://github.com/dingusdk/dukaonesdk/blob/master/readme.md) but has been rewritten from scratch in order to better separate 
responsibilities into different classes, while still being able to reuse shared logic.

The primary goal for this module is to create a Python client that makes communicating with Blauberg 
Vento(and its derivatives) a simple task. 

## Installation
```
python3 -m pip install blaubergvento_client
```

The module has the following 2 levels of communication:
1. A low level client that implements the communication protocol specified by Blauberg.
2. A high level client that utilizes the protocol client for easier usage.
 
## Protocol Client Example 

```
async def main():
    resource = Client()

    # 1. List devices (first page, 20 per page)
    devices = await resource.find_all(page=0, size=20)
    print(f"Total devices returned: {len(devices)}")
    for device in devices:

        print(f"Device ID: {device.id}, IP: Do-no, Mode: {device.mode}, Speed: {device.speed}")

    # 2. Find a specific device by ID
    device_id = devices[0].id if devices else None
    if device_id:
        device = await resource.find_by_id(device_id)
        print(f"\nDetails of device {device_id}: Mode={device.mode}, Speed={device.speed}")

        # 3. Modify device properties and save
        device.speed = Speed.HIGH
        updated_device = await resource.save(device)
        print(f"Updated device speed: {updated_device.speed}")

if __name__ == "__main__":
    asyncio.run(main())
```

## High Level Example

```
async def main():
    print("Searching for Blauberg Vento devices on the network...")

    client = ProtocolClient(timeout=2.0)  # Increase timeout if needed
    devices = await client.find_devices()

    if not devices:
        print("No devices found.")
    else:
        print(f"Found {len(devices)} device(s):")
        for idx, device in enumerate(devices, start=1):
            print(f"{idx}. ID: {device.id}, IP: {device.ip}")

if __name__ == "__main__":
    asyncio.run(main())

```

[You can see the documentation from Blauberg here](https://blaubergventilatoren.de/uploads/download/b133_4_1en_01preview.pdf)
