correct errors in parsing active logger

master
ademant 2019-08-16 11:03:57 +02:00
parent 26adfebb9d
commit bf1e0d04cc
1 changed files with 10 additions and 9 deletions

View File

@ -20,12 +20,13 @@ log_conf=json.load(cf)
cf.close()
sensors={
"bme280":{"enable":0,"script":"log_ads1x15.py","running":0},
"tristar":{"enable":0,"script":"log_ads1x15.py","running":0},
"vedirect":{"enable":0,"script":"log_ads1x15.py","running":0},
"mcp9808": {"enable":0,"script":"log_ads1x15.py","running":0},
"tsl2591":{"enable":0,"script":"log_ads1x15.py","running":0},
"veml6070":{"enable":0,"script":"log_ads1x15.py","running":0},
"bme280":{"enable":0,"script":"log_bme280.py","running":0},
"tristar":{"enable":0,"script":"log_tristar.py","running":0},
"vedirect":{"enable":0,"script":"log_vedirect.py","running":0},
"mcp9808": {"enable":0,"script":"log_mcp9808.py","running":0},
"tsl2591":{"enable":0,"script":"log_tsl2591.py","running":0},
"veml6070":{"enable":0,"script":"log_veml6070.py","running":0},
"w1therm":{"enable":0,"script":"log_w1.py","running":0},
"ads1x15":{"enable":0,"script":"log_ads1x15.py","running":0}
}
@ -131,11 +132,11 @@ def approot():
for p in psutil.process_iter():
if p.name() == 'python3':
sensor_list.append(p.cmdline()[1].split('/')[-1])
print("senslist"+sensor_list)
for sns in sensors:
print(sns)
if sensors[sns]['enable']==1:
sensors[sns]['running']= sensors[sns]['script']+'.py' in sensor_list
print(sensors)
print(sensors[sns]['script'])
sensors[sns]['running']= sensors[sns]['script'] in sensor_list
return template('main.tpl',server=socket.gethostname(),cpupercent=psutil.cpu_percent(),countticket=count_tickets,tickettime=last_ticket_time,measdata=measdata,sensors=sensors)
@app.post('/')
def submit_root():