Allow to group entities by domain (#20580)

Allow group entities by domain
This commit is contained in:
Bram Kragten 2024-04-22 18:27:13 +02:00 committed by GitHub
parent 62f46baacf
commit 4d21f9e80c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 3 deletions

View File

@ -94,6 +94,7 @@ import {
hasRejectedItems,
rejectedItems,
} from "../../../common/util/promise-all-settled-results";
import { domainToName } from "../../../data/integration";
export interface StateEntity
extends Omit<EntityRegistryEntry, "id" | "unique_id"> {
@ -110,6 +111,7 @@ export interface EntityRow extends StateEntity {
status: string | undefined;
area?: string;
localized_platform: string;
domain: string;
label_entries: LabelRegistryEntry[];
}
@ -261,6 +263,13 @@ export class HaConfigEntities extends SubscribeMixin(LitElement) {
filterable: true,
width: "20%",
},
domain: {
title: localize("ui.panel.config.entities.picker.headers.domain"),
sortable: true,
hidden: true,
filterable: true,
groupable: true,
},
area: {
title: localize("ui.panel.config.entities.picker.headers.area"),
sortable: true,
@ -467,9 +476,9 @@ export class HaConfigEntities extends SubscribeMixin(LitElement) {
),
unavailable,
restored,
localized_platform:
localize(`component.${entry.platform}.title`) || entry.platform,
localized_platform: domainToName(localize, entry.platform),
area: area ? area.name : "—",
domain: domainToName(localize, computeDomain(entry.entity_id)),
status: restored
? localize("ui.panel.config.entities.picker.status.restored")
: unavailable

View File

@ -4052,7 +4052,8 @@
"integration": "Integration",
"area": "Area",
"disabled_by": "Disabled by",
"status": "Status"
"status": "Status",
"domain": "Domain"
},
"selected": "{number} selected",
"enable_selected": {