Metadata-Version: 2.1
Name: litestar-mqtt
Version: 1.0.0
Summary: 
Author: Alessandro Ferrini
Author-email: im@alessandroferrini.com
Requires-Python: >=3.8,<4.0
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Dist: gmqtt (>=0.6.12,<0.7.0)
Requires-Dist: litestar (>=2.0.0,<3.0.0)
Requires-Dist: pydantic (>=2.0.0,<3.0.0)
Requires-Dist: pydantic-settings (>=2.0.0,<3.0.0)
Description-Content-Type: text/markdown

# litestar-mqtt

Litestar-mqtt is porting of [Fastapi-mqtt](https://github.com/sabuhish/fastapi-mqtt) for the [Litestar framework](https://github.com/litestar-org/litestar).

For more information about MQTT, please refer to the [Fastapi-mqtt MQTT](https://github.com/sabuhish/fastapi-mqtt/blob/master/MQTT.md) documentation.

As Fastapi-mqtt, Litestar-mqtt wraps around [gmqtt](https://github.com/wialon/gmqtt) module.

---
## Features: 
Litestar-mqtt implements the same feature of Fastapi-mqtt and also:
- Load configurations via ```.env``` file

```env
 MQTT_HOST="mqtt-dashboard.com"
```
---
## Installation: 
```sh
 $ pip install litestar-mqtt
```
or
```sh
 $ poetry add litestar-mqtt
```
---
## Differences: 
Litestar-mqtt must be hooked to the ```on_startup``` and ```on_shutdown``` handlers.

```python
 app = Litestar(
    route_handlers=[test_func],
    on_startup=[lite_mqtt.startup],
    on_shutdown=[lite_mqtt.shutdown],
)
```

