Update boswatch.py

-Auslagerung der Filter in 2. Datei
-hinzufügen einer globalen Variable für den Testbetrieb - Dadurch können Filter getestet werden ohne diese ständig eingeschaltet zu haben
This commit is contained in:
nobbie2009 2020-07-20 11:34:58 +02:00 committed by GitHub
parent 3a67131f79
commit 4a06653dd0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -156,7 +156,9 @@ try:
logging.debug("BOSWatch given arguments")
if args.test:
logging.debug(" - Test-Mode!")
globalVars.testvariable = 1
else:
globalVars.testvariable = 0
logging.debug(" - Frequency: %s", converter.freqToHz(args.freq))
logging.debug(" - Device: %s", args.device)
logging.debug(" - PPM Error: %s", args.error)
@ -202,7 +204,7 @@ try:
try:
logging.debug("reading config file")
globals.config = ConfigParser.ConfigParser()
globals.config.read(globals.script_path+"/config/config.ini")
globalVars.config.read([globalVars.script_path+"/config/config.ini", "/var/www/html/config_filter.ini"])
# if given loglevel is debug:
if globals.config.getint("BOSWatch","loglevel") == 10:
logging.debug(" - BOSWatch:")