diff --git a/src/data/entity_registry.ts b/src/data/entity_registry.ts index 9377c869cd..2ebfd15778 100644 --- a/src/data/entity_registry.ts +++ b/src/data/entity_registry.ts @@ -10,7 +10,7 @@ import { computeDomain } from "../common/entity/compute_domain"; export { subscribeEntityRegistryDisplay } from "./ws-entity_registry_display"; -type entityCategory = "config" | "diagnostic"; +type EntityCategory = "config" | "diagnostic"; export interface EntityRegistryDisplayEntry { entity_id: string; @@ -20,7 +20,7 @@ export interface EntityRegistryDisplayEntry { area_id?: string; labels: string[]; hidden?: boolean; - entity_category?: entityCategory; + entity_category?: EntityCategory; translation_key?: string; platform?: string; display_precision?: number; @@ -40,7 +40,7 @@ export interface EntityRegistryDisplayEntryResponse { hb?: boolean; dp?: number; }[]; - entity_categories: Record; + entity_categories: Record; } export interface EntityRegistryEntry { @@ -55,7 +55,7 @@ export interface EntityRegistryEntry { labels: string[]; disabled_by: "user" | "device" | "integration" | "config_entry" | null; hidden_by: Exclude; - entity_category: entityCategory | null; + entity_category: EntityCategory | null; has_entity_name: boolean; original_name?: string; unique_id: string; diff --git a/src/panels/config/automation/ha-automation-picker.ts b/src/panels/config/automation/ha-automation-picker.ts index a5fb93a70d..5057c1e4d1 100644 --- a/src/panels/config/automation/ha-automation-picker.ts +++ b/src/panels/config/automation/ha-automation-picker.ts @@ -18,6 +18,7 @@ import { UnsubscribeFunc } from "home-assistant-js-websocket"; import { CSSResultGroup, LitElement, + PropertyValues, TemplateResult, css, html, @@ -38,13 +39,15 @@ import type { DataTableColumnContainer, RowClickedEvent, } from "../../../components/data-table/ha-data-table"; +import "../../../components/data-table/ha-data-table-labels"; import "../../../components/entity/ha-entity-toggle"; import "../../../components/ha-fab"; -import "../../../components/ha-filter-floor-areas"; import "../../../components/ha-filter-blueprints"; import "../../../components/ha-filter-categories"; import "../../../components/ha-filter-devices"; import "../../../components/ha-filter-entities"; +import "../../../components/ha-filter-floor-areas"; +import "../../../components/ha-filter-labels"; import "../../../components/ha-icon-button"; import "../../../components/ha-icon-overflow-menu"; import "../../../components/ha-svg-icon"; @@ -64,6 +67,10 @@ import { import { fullEntitiesContext } from "../../../data/context"; import { UNAVAILABLE } from "../../../data/entity"; import { EntityRegistryEntry } from "../../../data/entity_registry"; +import { + LabelRegistryEntry, + subscribeLabelRegistry, +} from "../../../data/label_registry"; import { findRelated } from "../../../data/search"; import { showAlertDialog, @@ -77,12 +84,6 @@ import { documentationUrl } from "../../../util/documentation-url"; import { showAssignCategoryDialog } from "../category/show-dialog-assign-category"; import { configSections } from "../ha-panel-config"; import { showNewAutomationDialog } from "./show-dialog-new-automation"; -import "../../../components/data-table/ha-data-table-labels"; -import { - LabelRegistryEntry, - subscribeLabelRegistry, -} from "../../../data/label_registry"; -import "../../../components/ha-filter-labels"; type AutomationItem = AutomationEntity & { name: string; @@ -509,6 +510,13 @@ class HaAutomationPicker extends SubscribeMixin(LitElement) { `; } + protected updated(changedProps: PropertyValues) { + super.updated(changedProps); + if (changedProps.has("_entityReg")) { + this._applyFilters(); + } + } + firstUpdated() { if (this._searchParms.has("blueprint")) { this._filterBlueprint(); diff --git a/src/panels/config/scene/ha-scene-dashboard.ts b/src/panels/config/scene/ha-scene-dashboard.ts index 2f02ae82a9..36826e56df 100644 --- a/src/panels/config/scene/ha-scene-dashboard.ts +++ b/src/panels/config/scene/ha-scene-dashboard.ts @@ -16,6 +16,7 @@ import { UnsubscribeFunc } from "home-assistant-js-websocket"; import { CSSResultGroup, LitElement, + PropertyValues, TemplateResult, css, html, @@ -297,6 +298,13 @@ class HaSceneDashboard extends SubscribeMixin(LitElement) { } ); + protected updated(changedProps: PropertyValues) { + super.updated(changedProps); + if (changedProps.has("_entityReg")) { + this._applyFilters(); + } + } + protected hassSubscribe(): (UnsubscribeFunc | Promise)[] { return [ subscribeCategoryRegistry(this.hass.connection, "scene", (categories) => { diff --git a/src/panels/config/script/ha-script-picker.ts b/src/panels/config/script/ha-script-picker.ts index 4449f1e7fe..fa9a4b9208 100644 --- a/src/panels/config/script/ha-script-picker.ts +++ b/src/panels/config/script/ha-script-picker.ts @@ -15,6 +15,7 @@ import { UnsubscribeFunc } from "home-assistant-js-websocket"; import { CSSResultGroup, LitElement, + PropertyValues, TemplateResult, css, html, @@ -560,6 +561,13 @@ class HaScriptPicker extends SubscribeMixin(LitElement) { this._filteredScripts = items ? [...items] : undefined; } + protected updated(changedProps: PropertyValues) { + super.updated(changedProps); + if (changedProps.has("_entityReg")) { + this._applyFilters(); + } + } + firstUpdated() { if (this._searchParms.has("blueprint")) { this._filterBlueprint();