1
0
mirror of https://github.com/beestat/app.git synced 2026-02-13 15:04:38 -05:00
beestat/js/beestat/sensor.js
Jon Ziebell 36c24ffa92 Sensor Data 🤞
Finished outstanding features, fixed lots of bugs, enabled for the general population. #17
2020-02-08 14:18:09 -05:00

23 lines
535 B
JavaScript

beestat.sensor = {};
/**
* Get a sorted list of all sensors attached to the current thermostat.
*
* @return {array} The sensors.
*/
beestat.sensor.get_sorted = function() {
// Get and sort all the sensors.
var sensors = [];
$.values(beestat.cache.sensor).forEach(function(sensor) {
if (sensor.thermostat_id === beestat.setting('thermostat_id')) {
sensors.push(sensor);
}
});
sensors.sort(function(a, b) {
return a.name.localeCompare(b.name, 'en', {'sensitivity': 'base'});
});
return sensors;
};