Moved config to external file

This commit is contained in:
mverleun
2018-07-05 08:38:34 +02:00
parent 35c7a1567d
commit e3163163d4
2 changed files with 10 additions and 9 deletions

9
src/config.py.example Normal file
View File

@@ -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

View File

@@ -8,15 +8,7 @@ import paho.mqtt.client as mqtt
import os import os
import json import json
# Config section from config import *
# 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
rtl_433_cmd = "/usr/local/bin/rtl_433 -G -F json" # linux rtl_433_cmd = "/usr/local/bin/rtl_433 -G -F json" # linux