diff options
| author | Elena ``of Valhalla'' Grandi <valhalla@trueelena.org> | 2023-12-08 10:20:36 +0100 | 
|---|---|---|
| committer | Elena ``of Valhalla'' Grandi <valhalla@trueelena.org> | 2023-12-29 07:29:15 +0100 | 
| commit | 5973b7ca26e63880e9d74a52fa9e2ec61c811401 (patch) | |
| tree | 818b1d3e0a9daeb9561c8771f2dea06e906bf693 /rrd/management/commands | |
| parent | 0a56d27c3b0f590e0eef85666bb0d10d36041089 (diff) | |
Management command for the mqtt loop
Diffstat (limited to 'rrd/management/commands')
| -rw-r--r-- | rrd/management/commands/__init__.py | 0 | ||||
| -rw-r--r-- | rrd/management/commands/listen_mqtt.py | 10 | 
2 files changed, 10 insertions, 0 deletions
diff --git a/rrd/management/commands/__init__.py b/rrd/management/commands/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/rrd/management/commands/__init__.py diff --git a/rrd/management/commands/listen_mqtt.py b/rrd/management/commands/listen_mqtt.py new file mode 100644 index 0000000..758a4f2 --- /dev/null +++ b/rrd/management/commands/listen_mqtt.py @@ -0,0 +1,10 @@ +from django.core.management.base import BaseCommand + +import rrd.mqtt + +class Command(BaseCommand): +    help = "Listen to mqtt events and update rrd files and graphs" + +    def handle(self, *args, **kw): +        mqtt_client = rrd.mqtt.MQTTClient() +        mqtt_client.loop_forever()  | 
