Commit c1f094ac authored by mik's avatar mik

prometheus hat _ statt . und zeilenumbruch falschrum

parent 84898a27
......@@ -103,14 +103,14 @@ def generate_hackerspaceapi_metrics():
try:
if "valuetype" in sensor.keys():
if sensor['valuetype'] == 'int':
resp = resp + "\r\n" + sensor['topic'].replace('/','.') + " " + str(int(str(r.get(sensor['topic']),'utf-8')))
resp = resp + sensor['topic'].replace('/','_') + " " + str(int(str(r.get(sensor['topic']),'utf-8'))) + "\n"
elif sensor['valuetype'] == 'doorboolean':
if str(r.get(sensor['topic']),'utf-8') == "UNLOCKED":
resp = resp + "\r\n" + sensor['topic'].replace('/','.') + " 1"
resp = resp + sensor['topic'].replace('/','_') + " 1\n"
else:
resp = resp + "\r\n" + sensor['topic'].replace('/','.') + " 0"
resp = resp + sensor['topic'].replace('/','_') + " 0\n"
else:
resp = resp + "\r\n" + sensor['topic'].replace('/','.') + " " + str((str(r.get(sensor['topic']),'utf-8')))
resp = resp + sensor['topic'].replace('/','_') + " " + str((str(r.get(sensor['topic']),'utf-8'))) + "\n"
#if sensor['valuetype'] == 'string':
# pass
# #value = str(r.get(sensor['topic']),'utf-8')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment