mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +00:00
Properly sort config entities (#353)
This commit is contained in:
parent
6c45c5554a
commit
4c14e51079
@ -8,6 +8,7 @@
|
|||||||
<link rel='import' href='../../../bower_components/paper-item/paper-item.html'>
|
<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/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-config-section.html">
|
||||||
<link rel="import" href="../ha-entity-config.html">
|
<link rel="import" href="../ha-entity-config.html">
|
||||||
@ -71,15 +72,7 @@ Polymer({
|
|||||||
return (window.hassUtil.computeDomain(entity) === 'group' &&
|
return (window.hassUtil.computeDomain(entity) === 'group' &&
|
||||||
!entity.attributes.auto);
|
!entity.attributes.auto);
|
||||||
})
|
})
|
||||||
.sort(function (entityA, entityB) {
|
.sort(window.hassUtil.sortByName);
|
||||||
if (entityA.entity_id < entityB.entity_id) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
if (entityA.entity_id > entityB.entity_id) {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
<link rel='import' href='../../../bower_components/paper-item/paper-item.html'>
|
<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/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-config-section.html">
|
||||||
<link rel="import" href="../ha-entity-config.html">
|
<link rel="import" href="../ha-entity-config.html">
|
||||||
@ -68,15 +69,7 @@ Polymer({
|
|||||||
return (!ent.attributes.hidden &&
|
return (!ent.attributes.hidden &&
|
||||||
'node_id' in ent.attributes);
|
'node_id' in ent.attributes);
|
||||||
})
|
})
|
||||||
.sort(function (entityA, entityB) {
|
.sort(window.hassUtil.sortByName);
|
||||||
if (entityA.entity_id < entityB.entity_id) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
if (entityA.entity_id > entityB.entity_id) {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user