modified to use events, hopefully will fix the crashing particle

This commit is contained in:
Martin Donnelly 2016-02-12 16:29:56 +00:00
parent 31ba1ebb94
commit da0b134f53

View File

@ -132,7 +132,7 @@ router.post('/', function (req, res, next) {
logger.debug('We have data');
var data = JSON.parse(t.data.toString());
if (data.hasOwnProperty(temp)) {
if (data.hasOwnProperty('temp')) {
logger.log('We have temp! ' + data.temp);
busEmitter.emit("saveTempData", {time: now.toJSON(), value: parseFloat(data.temp)});
}