mirror of
https://github.com/beestat/app.git
synced 2026-02-13 15:04:38 -05:00
Finished outstanding features, fixed lots of bugs, enabled for the general population. #17
23 lines
535 B
JavaScript
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;
|
|
};
|