From 53821074d608750fd0c51fddd86e7e2462c3bfae Mon Sep 17 00:00:00 2001 From: Sebastian Lohff Date: Sun, 10 Jan 2021 03:16:51 +0100 Subject: [PATCH] Rename mqtt_topic to default topic --- mqtt_sensord/mqtt_sensord.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mqtt_sensord/mqtt_sensord.py b/mqtt_sensord/mqtt_sensord.py index 8c32012..ae4efb9 100755 --- a/mqtt_sensord/mqtt_sensord.py +++ b/mqtt_sensord/mqtt_sensord.py @@ -37,8 +37,8 @@ def main(): client_id = None mqtt = MQTTClient(mcfg['host'], mcfg['user'], mcfg['password'], client_id) - mqtt_topic = mcfg['sensor_topic'] - print("Connected to", mqtt.host, "with topic", mqtt_topic) + default_mqtt_topic = mcfg.get('sensor_topic') + print("Connected to", mqtt.host, "with default topic", default_mqtt_topic) mqtt.set_callback(sensorlib.Sensor.run_mqtt_callback) sensors = [] @@ -63,8 +63,8 @@ def main(): if sensor.HAS_SENSOR_DATA: data = sensor.gen_datapoint() if debug: - print(mqtt_topic, data) - mqtt.send_data(mqtt_topic, data) + print(default_mqtt_topic, data) + mqtt.send_data(default_mqtt_topic, data) if not mqtt.is_async(): mqtt.process_mqtt()