add new switches
This commit is contained in:
@ -15,6 +15,9 @@ switchMapping = {
|
||||
'oven': { 'index': 1, 'label': 'Herd' },
|
||||
'laundry': { 'index': 2, 'label': 'Waschkueche' },
|
||||
'kitchen': { 'index': 0, 'label': 'Kueche' },
|
||||
'lightbasem': { 'index': 3, 'label': 'Licht Keller' },
|
||||
'light1flr': { 'index': 4, 'label': 'Licht EG' },
|
||||
'light2flr': { 'index': 5, 'label': 'Licht OG' },
|
||||
}
|
||||
|
||||
|
||||
|
@ -11,8 +11,9 @@
|
||||
async: false
|
||||
});
|
||||
var switchMapping = $.getJSON('/switchMapping').responseJSON;
|
||||
var sortedKeys = Object.keys(switchMapping).sort(function(a,b){return switchMapping[a]['index'] - switchMapping[b]['index']});
|
||||
var firstListItem = $("li:first", "#switchlist");
|
||||
for (var key in switchMapping) {
|
||||
for (var key in sortedKeys) {
|
||||
var newListItem = firstListItem.clone()
|
||||
var href = newListItem.children('a')
|
||||
href.attr('id', key);
|
||||
|
Reference in New Issue
Block a user