summaryrefslogtreecommitdiff
path: root/iot_barcode_scanner/mqtt.py
diff options
context:
space:
mode:
authorxengineering <mail2xengineering@protonmail.com>2020-10-29 12:11:32 +0100
committerxengineering <mail2xengineering@protonmail.com>2020-10-29 12:15:46 +0100
commit84b9ddcc2905f5d8667cfef1359b724c23d27365 (patch)
tree4e5a4c9ba39d8ec8c1a63a2bda4d7e9fc402ae40 /iot_barcode_scanner/mqtt.py
parent56503ecf9bccd9a318142e2946f84e5f57be5eeb (diff)
downloadiot-barcode-scanner-84b9ddcc2905f5d8667cfef1359b724c23d27365.tar
iot-barcode-scanner-84b9ddcc2905f5d8667cfef1359b724c23d27365.tar.zst
iot-barcode-scanner-84b9ddcc2905f5d8667cfef1359b724c23d27365.zip
Setup basic Systemd Units
Diffstat (limited to 'iot_barcode_scanner/mqtt.py')
-rw-r--r--iot_barcode_scanner/mqtt.py27
1 files changed, 0 insertions, 27 deletions
diff --git a/iot_barcode_scanner/mqtt.py b/iot_barcode_scanner/mqtt.py
deleted file mode 100644
index c5a075c..0000000
--- a/iot_barcode_scanner/mqtt.py
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-"""Provide MQTT Functionality for the Package"""
-
-
-import paho.mqtt.client as mqtt
-
-
-class MqttService():
- """Bundle for MQTT Functionality"""
-
- def __init__(self, config):
- self.config = config
- self.client = mqtt.Client()
- self.client.on_connect = self.on_connect
-
- def run(self):
- self.client.connect(
- self.config["mqtt"]["broker"],
- self.config["mqtt"]["port"],
- 60
- )
- self.client.loop_start()
-
- def on_connect(self, client, userdata, flags, rc):
- print("Connected with result code " + str(rc))
- client.subscribe(self.config["mqtt"]["topic"])