From e3163163d431afb603cecd8b8528b53668237bea Mon Sep 17 00:00:00 2001 From: mverleun Date: Thu, 5 Jul 2018 08:38:34 +0200 Subject: [PATCH] Moved config to external file --- src/config.py.example | 9 +++++++++ src/rtl2mqtt.py | 10 +--------- 2 files changed, 10 insertions(+), 9 deletions(-) create mode 100644 src/config.py.example diff --git a/src/config.py.example b/src/config.py.example new file mode 100644 index 0000000..f5e6e67 --- /dev/null +++ b/src/config.py.example @@ -0,0 +1,9 @@ +# Config section +# Uncomment these lines if your MQTT server requires authentication +#MQTT_USER="mqtt-user" +#MQTT_PASS="mqtt-password" +MQTT_HOST="mqtt.example.com" +MQTT_PORT=1883 +MQTT_TOPIC="sensors/rtl_433" +MQTT_QOS=0 +# End config section diff --git a/src/rtl2mqtt.py b/src/rtl2mqtt.py index e542cf8..4e0e528 100755 --- a/src/rtl2mqtt.py +++ b/src/rtl2mqtt.py @@ -8,15 +8,7 @@ import paho.mqtt.client as mqtt import os import json -# Config section -# Uncomment these lines if your MQTT server requires authentication -#MQTT_USER="mqtt-user" -#MQTT_PASS="mqtt-password" -MQTT_HOST="mqtt.example.com" -MQTT_PORT=1883 -MQTT_TOPIC="sensors/rtl_433" -MQTT_QOS=0 -# End config section +from config import * rtl_433_cmd = "/usr/local/bin/rtl_433 -G -F json" # linux