From 723700c64e09a397f7f459c2d697dba5e587df55 Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Sat, 20 Jan 2018 18:55:53 +0100 Subject: [PATCH] publish einsatzrapport json --- README.md | 4 ++-- library/mqtt.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 781a15f..232a1b1 100644 --- a/README.md +++ b/README.md @@ -79,9 +79,9 @@ Wird ein neuer Einsatz registriert (E-Mail mit dem Betreff * `pylokid/Einsatzausdruck_FW//json`: Geparste Daten als JSON Ist der Einsatz beendet (E-Mail mit dem Betreff "Einsatzprotokoll") -wird folgedes Topic published: +wird folgendes Topic published: -* `pylokid/Einsatzprotokoll//json`: Leeres JSON +* `pylokid/Einsatzprotokoll//json`: Geparste Daten als JSON Der Dashboard Client `dashboard_client.py` subscribed auf diese Topics und zeigt mittels `xpdf` das PDF im Vollbild an. Ist der Einsatz vorbei, diff --git a/library/mqtt.py b/library/mqtt.py index 12ff796..89d4785 100644 --- a/library/mqtt.py +++ b/library/mqtt.py @@ -44,4 +44,4 @@ class MQTTClient: elif f_type == 'Einsatzprotokoll': topic = "{0}/Einsatzprotokoll/{1}/".format(self.base_topic, f_id) self.logger.info('[%s] Publishing information on MQTT topic %s', f_id, topic) - self.mqtt_client.publish(topic + 'json', '{}') + self.mqtt_client.publish(topic + 'json', json.dumps(pdf_data))