From 84b9ddcc2905f5d8667cfef1359b724c23d27365 Mon Sep 17 00:00:00 2001 From: xengineering Date: Thu, 29 Oct 2020 12:11:32 +0100 Subject: Setup basic Systemd Units --- iot_barcode_scanner/mqtt.py | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100644 iot_barcode_scanner/mqtt.py (limited to 'iot_barcode_scanner/mqtt.py') 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"]) -- cgit v1.2.3-70-g09d2