Properly sort config entities (#353)

This commit is contained in:
Andrey 2017-07-24 15:18:30 +09:00 committed by Paulus Schoutsen
parent 6c45c5554a
commit 4c14e51079
2 changed files with 4 additions and 18 deletions

View File

@ -8,6 +8,7 @@
<link rel='import' href='../../../bower_components/paper-item/paper-item.html'>
<link rel="import" href="../../../src/resources/ha-style.html">
<link rel="import" href="../../../src/util/hass-util.html">
<link rel="import" href="../ha-config-section.html">
<link rel="import" href="../ha-entity-config.html">
@ -71,15 +72,7 @@ Polymer({
return (window.hassUtil.computeDomain(entity) === 'group' &&
!entity.attributes.auto);
})
.sort(function (entityA, entityB) {
if (entityA.entity_id < entityB.entity_id) {
return -1;
}
if (entityA.entity_id > entityB.entity_id) {
return 1;
}
return 0;
});
.sort(window.hassUtil.sortByName);
},
});
</script>

View File

@ -8,6 +8,7 @@
<link rel='import' href='../../../bower_components/paper-item/paper-item.html'>
<link rel="import" href="../../../src/resources/ha-style.html">
<link rel="import" href="../../../src/util/hass-util.html">
<link rel="import" href="../ha-config-section.html">
<link rel="import" href="../ha-entity-config.html">
@ -68,15 +69,7 @@ Polymer({
return (!ent.attributes.hidden &&
'node_id' in ent.attributes);
})
.sort(function (entityA, entityB) {
if (entityA.entity_id < entityB.entity_id) {
return -1;
}
if (entityA.entity_id > entityB.entity_id) {
return 1;
}
return 0;
});
.sort(window.hassUtil.sortByName);
},
});
</script>