alarm triggering / silencing works
This commit is contained in:
@@ -25,14 +25,17 @@ function last_sensor_reading() {
|
||||
|
||||
Template.alarm.helpers({
|
||||
last_reading: last_sensor_reading,
|
||||
state: function() {
|
||||
return Meteor.zoblak.client.controller_state().state;
|
||||
},
|
||||
pretty_time: function(time) {
|
||||
return moment(time).format("DD.MM.YYYY, HH:mm")
|
||||
},
|
||||
all_temperatures: function() {
|
||||
var result="";
|
||||
var result = "";
|
||||
var temperatures = last_sensor_reading().temperatures;
|
||||
|
||||
for(var i in temperatures) {
|
||||
for (var i in temperatures) {
|
||||
result += '' + parseFloat(temperatures[i]).toFixed(1) + ' °C ';
|
||||
}
|
||||
return result;
|
||||
@@ -42,6 +45,10 @@ Template.alarm.helpers({
|
||||
Template.alarm.events({
|
||||
'click #run_alarm_settings': function() {
|
||||
Modal.show('alarm_settings');
|
||||
},
|
||||
'click #stop_alarm': function() {
|
||||
let controller_id = Meteor.zoblak.client.controller_state().controller_id;
|
||||
Meteor.call('stopTheAlarm', controller_id);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user