saving and temperature works
This commit is contained in:
@@ -13,6 +13,7 @@ Api.addRoute('sensorData', {
|
||||
var sensorObject = {
|
||||
temperatureValue: parseFloat(this.bodyParams.temperatureValue),
|
||||
humidityValue: parseFloat(this.bodyParams.humidityValue),
|
||||
temperatures: this.bodyParams.temperatures,
|
||||
tankLevel0: this.bodyParams.tankLevel0,
|
||||
tankLevel1: this.bodyParams.tankLevel1,
|
||||
tankLevel2: this.bodyParams.tankLevel2,
|
||||
@@ -96,6 +97,20 @@ reactToSensorData = function(nextSensorReading) {
|
||||
}
|
||||
}
|
||||
|
||||
Api.addRoute('alarm/:id/stop', {
|
||||
authRequired: false
|
||||
}, {
|
||||
post: function() {
|
||||
var state = Meteor.zoblak.server.controller_state(controller_id);
|
||||
ControllerState.update(state._id, {
|
||||
'$set': {
|
||||
'state.alarmTriggered': false,
|
||||
'state.alarmStopped': new Date()
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Api.addRoute('state/:id', {
|
||||
authRequired: false
|
||||
}, {
|
||||
|
||||
Reference in New Issue
Block a user