add temperature for whatever

This commit is contained in:
Wolfgang Hottgenroth 2016-10-23 13:43:30 +02:00
parent 43cf7396c1
commit ebb18e3d66

View File

@ -22,7 +22,7 @@ class MonitorPublisher(threading.Thread):
'freezer': { 'oldbody':'', 'body':'', 'slot': 6, 'header': 'Gefrier.', 'cnt': 0 },
'electricity': { 'oldbody':'', 'body':'', 'slot': 7, 'header': 'Strom', 'cnt': 0 },
'thermom.': { 'oldbody':'', 'body':'', 'slot': 8, 'header': 'Temp.', 'cnt': 0 },
'fridge_x': { 'oldbody':'', 'body':'', 'slot': 9, 'header': 'Gefr.T.', 'cnt': 0 },
'fridge': { 'oldbody':'', 'body':'', 'slot': 9, 'header': 'Gefr.T.', 'cnt': 0 },
'os_x': { 'oldbody':'', 'body':'', 'slot': 10, 'header': 'Server', 'cnt': 0 },
}
@ -46,6 +46,8 @@ class MonitorPublisher(threading.Thread):
self.nameMap[name]['body'] = str(dataBlock['power'])
elif name == 'thermom.':
self.nameMap[name]['body'] = "{0:.2f}".format(dataBlock['temperature2'])
elif name == 'fridge':
self.nameMap[name]['body'] = "{0:.2f}".format(dataBlock['t2'])
if (self.nameMap[name]['oldbody'] != self.nameMap[name]['body']) or (self.nameMap[name]['cnt'] == 10):
self.nameMap[name]['cnt'] = 0;