mirror of
https://github.com/home-assistant/frontend.git
synced 2025-08-01 13:37:47 +00:00
Sort ungrouped entities (#5047)
* Sort ungrouped entities * Console.bye
This commit is contained in:
parent
7e48b21767
commit
f3445d99cf
@ -42,6 +42,7 @@ import {
|
||||
} from "../../../data/entity_registry";
|
||||
import { processEditorEntities } from "../editor/process-editor-entities";
|
||||
import { SENSOR_DEVICE_CLASS_BATTERY } from "../../../data/sensor";
|
||||
import { compare } from "../../../common/string/compare";
|
||||
|
||||
const DEFAULT_VIEW_ENTITY_ID = "group.default_view";
|
||||
const DOMAINS_BADGES = [
|
||||
@ -344,10 +345,17 @@ const generateViewConfig = (
|
||||
.forEach((domain) => {
|
||||
cards = cards.concat(
|
||||
computeCards(
|
||||
ungroupedEntitites[domain].map((entityId): [string, HassEntity] => [
|
||||
entityId,
|
||||
entities[entityId],
|
||||
]),
|
||||
ungroupedEntitites[domain]
|
||||
.sort((a, b) =>
|
||||
compare(
|
||||
computeStateName(entities[a]),
|
||||
computeStateName(entities[b])
|
||||
)
|
||||
)
|
||||
.map((entityId): [string, HassEntity] => [
|
||||
entityId,
|
||||
entities[entityId],
|
||||
]),
|
||||
{
|
||||
title: localize(`domain.${domain}`),
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user