mirror of
https://github.com/home-assistant/frontend.git
synced 2025-12-20 02:38:53 +00:00
Add area to helpers table (#28460)
This commit is contained in:
@@ -25,6 +25,7 @@ import { computeCssColor } from "../../../common/color/compute-color";
|
||||
import { storage } from "../../../common/decorators/storage";
|
||||
import type { HASSDomEvent } from "../../../common/dom/fire_event";
|
||||
import { computeStateDomain } from "../../../common/entity/compute_state_domain";
|
||||
import { computeAreaName } from "../../../common/entity/compute_area_name";
|
||||
import { navigate } from "../../../common/navigate";
|
||||
import type {
|
||||
LocalizeFunc,
|
||||
@@ -132,6 +133,7 @@ interface HelperItem {
|
||||
configEntry?: ConfigEntry;
|
||||
entity?: HassEntity;
|
||||
category: string | undefined;
|
||||
area?: string;
|
||||
label_entries: LabelRegistryEntry[];
|
||||
disabled?: boolean;
|
||||
}
|
||||
@@ -347,6 +349,12 @@ export class HaConfigHelpers extends SubscribeMixin(LitElement) {
|
||||
filterable: true,
|
||||
sortable: true,
|
||||
},
|
||||
area: {
|
||||
title: localize("ui.panel.config.helpers.picker.headers.area"),
|
||||
sortable: true,
|
||||
filterable: true,
|
||||
groupable: true,
|
||||
},
|
||||
labels: {
|
||||
title: "",
|
||||
hidden: true,
|
||||
@@ -565,6 +573,11 @@ export class HaConfigHelpers extends SubscribeMixin(LitElement) {
|
||||
entityRegistryByEntityId(entityReg)[item.entity_id];
|
||||
const labels = labelReg && entityRegEntry?.labels;
|
||||
const category = entityRegEntry?.categories.helpers;
|
||||
const areaId = entityRegEntry?.area_id;
|
||||
const area =
|
||||
areaId && this.hass.areas?.[areaId]
|
||||
? computeAreaName(this.hass.areas[areaId])
|
||||
: undefined;
|
||||
return {
|
||||
...item,
|
||||
localized_type:
|
||||
@@ -579,6 +592,7 @@ export class HaConfigHelpers extends SubscribeMixin(LitElement) {
|
||||
category: category
|
||||
? categoryReg?.find((cat) => cat.category_id === category)?.name
|
||||
: undefined,
|
||||
area,
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
@@ -3304,7 +3304,8 @@
|
||||
"entity_id": "Entity ID",
|
||||
"type": "Type",
|
||||
"editable": "Editable",
|
||||
"category": "Category"
|
||||
"category": "Category",
|
||||
"area": "Area"
|
||||
},
|
||||
"create_helper": "Create helper",
|
||||
"no_helpers": "Looks like you don't have any helpers yet!",
|
||||
|
||||
Reference in New Issue
Block a user