charts are up

This commit is contained in:
Senad Uka
2017-05-21 17:51:45 +02:00
parent 8c236609e8
commit e86ef0ba3a
13 changed files with 239 additions and 35 deletions

View File

@@ -63,8 +63,10 @@ Api.addRoute('alarm/:id/phonePing', {
reactToSensorData = function(nextSensorReading) {
console.log("reacting to sensor");
var controllerId = nextSensorReading.controllerId;
console.log("reacting to sensor ", nextSensorReading);
var stateObject = stateOrDefault(controllerId);
var state = stateObject.state;
var config = stateObject.config;
@@ -201,8 +203,8 @@ function stateOrDefault(id) {
manualInflow: true
},
features: {
start: true,
weather: true,
start: false,
weather: false,
surveillance: true,
log: true,
alarm: true

View File

@@ -218,6 +218,7 @@ reactToAlarmData = function(controller_id) {
return Meteor.zoblak.shared.valid_temperature(temperature) && is_on;
});
console.log("Konfiguracija: ", controller_id, config);
var tooCold = config.minTemperature && (minTemperature(temperatures) < config.minTemperature);

View File

@@ -5,8 +5,7 @@ Meteor.publish("sensor_data", function(controllerId) {
}, {
sort: {
created_at: -1
},
limit: 100
}
});
});

View File

@@ -4,6 +4,7 @@ if (Meteor.isServer) {
SyncedCron.start();
Meteor.zoblak.server.on_all_controllers(function(controller_id) {
if(!controller_id) { return; }; // protects from null controller_id
var jobName = "automatic_alarm_" + controller_id;
SyncedCron.remove(jobName);