mirror of
https://github.com/beestat/app.git
synced 2025-06-05 14:48:34 -04:00
Resolved issues with down notification.
This commit is contained in:
parent
967bb5d446
commit
131fee9442
@ -16,7 +16,7 @@ class sensor extends cora\crud {
|
|||||||
];
|
];
|
||||||
|
|
||||||
public static $cache = [
|
public static $cache = [
|
||||||
'sync' => 300 // 5 Minutes
|
'sync' => 180 // 3 Minutes
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -18,7 +18,7 @@ class thermostat extends cora\crud {
|
|||||||
];
|
];
|
||||||
|
|
||||||
public static $cache = [
|
public static $cache = [
|
||||||
'sync' => 300 // 5 Minutes
|
'sync' => 180 // 3 Minutes
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -16,10 +16,10 @@ beestat.ecobee.notify_if_down = function() {
|
|||||||
beestat.ecobee.down_notification_ = new beestat.component.down_notification();
|
beestat.ecobee.down_notification_ = new beestat.component.down_notification();
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (down === true) {
|
if (down === true) {
|
||||||
// beestat.ecobee.down_notification_.render($('body'));
|
beestat.ecobee.down_notification_.render($('body'));
|
||||||
// } else {
|
} else {
|
||||||
// beestat.ecobee.down_notification_.dispose();
|
beestat.ecobee.down_notification_.dispose();
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -36,6 +36,20 @@ beestat.disable_poll = function() {
|
|||||||
beestat.poll = function() {
|
beestat.poll = function() {
|
||||||
var api = new beestat.api();
|
var api = new beestat.api();
|
||||||
|
|
||||||
|
api.add_call(
|
||||||
|
'thermostat',
|
||||||
|
'sync',
|
||||||
|
{},
|
||||||
|
'thermostat_sync'
|
||||||
|
);
|
||||||
|
|
||||||
|
api.add_call(
|
||||||
|
'sensor',
|
||||||
|
'sync',
|
||||||
|
{},
|
||||||
|
'sensor_sync'
|
||||||
|
);
|
||||||
|
|
||||||
api.add_call(
|
api.add_call(
|
||||||
'user',
|
'user',
|
||||||
'read_id',
|
'read_id',
|
||||||
@ -94,7 +108,6 @@ beestat.poll = function() {
|
|||||||
beestat.cache.set('ecobee_thermostat', response.ecobee_thermostat);
|
beestat.cache.set('ecobee_thermostat', response.ecobee_thermostat);
|
||||||
beestat.cache.set('ecobee_sensor', response.ecobee_sensor);
|
beestat.cache.set('ecobee_sensor', response.ecobee_sensor);
|
||||||
beestat.enable_poll();
|
beestat.enable_poll();
|
||||||
beestat.dispatcher.dispatchEvent('poll');
|
|
||||||
|
|
||||||
beestat.ecobee.notify_if_down();
|
beestat.ecobee.notify_if_down();
|
||||||
});
|
});
|
||||||
|
@ -3,9 +3,18 @@
|
|||||||
*/
|
*/
|
||||||
beestat.component.card.sensors = function() {
|
beestat.component.card.sensors = function() {
|
||||||
var self = this;
|
var self = this;
|
||||||
beestat.dispatcher.addEventListener('poll', function() {
|
|
||||||
|
var change_function = beestat.debounce(function() {
|
||||||
self.rerender();
|
self.rerender();
|
||||||
});
|
}, 10);
|
||||||
|
|
||||||
|
beestat.dispatcher.addEventListener(
|
||||||
|
[
|
||||||
|
'cache.thermostat',
|
||||||
|
'cache.ecobee_thermostat'
|
||||||
|
],
|
||||||
|
change_function
|
||||||
|
);
|
||||||
|
|
||||||
beestat.component.card.apply(this, arguments);
|
beestat.component.card.apply(this, arguments);
|
||||||
};
|
};
|
||||||
|
@ -5,9 +5,17 @@
|
|||||||
beestat.component.card.system = function() {
|
beestat.component.card.system = function() {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
beestat.dispatcher.addEventListener('poll', function() {
|
var change_function = beestat.debounce(function() {
|
||||||
self.rerender();
|
self.rerender();
|
||||||
});
|
}, 10);
|
||||||
|
|
||||||
|
beestat.dispatcher.addEventListener(
|
||||||
|
[
|
||||||
|
'cache.thermostat',
|
||||||
|
'cache.ecobee_thermostat'
|
||||||
|
],
|
||||||
|
change_function
|
||||||
|
);
|
||||||
|
|
||||||
beestat.component.card.apply(this, arguments);
|
beestat.component.card.apply(this, arguments);
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user