Metadata-Version: 2.1
Name: inels-mqtt-wrapper
Version: 0.1.0
Summary: A Python library to work with Inels devices over MQTT (using Asyncio)
Home-page: https://github.com/Multi-Agent-io/inels-mqtt-wrapper
License: Apache 2.0
Author: arseniiarsenii
Author-email: arseniivelichko2@gmail.com
Requires-Python: >=3.8,<4.0
Classifier: License :: Other/Proprietary License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Requires-Dist: asyncio-mqtt (>=0.13.0,<0.14.0)
Description-Content-Type: text/markdown

# Inels MQTT wrapper

A Python library to work with Inels smart home devices over MQTT (using Asyncio).

---

## Demo code

Below is a simple code snippet to demonstrate the basic interaction with this library.

```python
import asyncio

import asyncio_mqtt as aiomqtt

from inels_mqtt_wrapper import RFDAC71B, DeviceStatusUnknownError


async def main() -> None:
    """Entrypoint"""

    async with aiomqtt.Client("localhost") as client:
        device = RFDAC71B(
            mac_address="00:00:00:00:00:00",  # Your gateway's MAC address
            device_address="01207D",  # Your device's address (found on the device's top case)
            mqtt_client=client,  # An instance of asyncio_mqtt.Client
        )
        print("Connected:", device.is_connected)  # True

        try:
            print(device.status)  # A dict containing device-specific status data
        except DeviceStatusUnknownError as e:
            print(e)  # Print the error if the device status is unknown

        await device.set_brightness_percentage(50)  # Set the device's brightness to 50%
        await device.without_function()  # Apply the before set brightness percentage

        try:
            print(device.status)  # Check the device status again
        except DeviceStatusUnknownError as e:
            print(e)  # Print the error if the device status is unknown


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

