1
0
mirror of https://github.com/home-assistant/frontend.git synced 2026-04-19 00:12:51 +01:00

Move loadConfig to common mixin (#30171)

This commit is contained in:
karwosts
2026-03-16 08:34:41 -07:00
committed by GitHub
parent 619c75ac8b
commit e2e5feb8d5
6 changed files with 102 additions and 123 deletions

View File

@@ -146,8 +146,6 @@ class HaScriptPicker extends SubscribeMixin(LitElement) {
@property({ attribute: false }) public cloudStatus?: CloudStatus;
@property({ attribute: false }) public entityRegistry!: EntityRegistryEntry[];
@state() private _searchParms = new URLSearchParams(window.location.search);
@state() private _selected: string[] = [];
@@ -933,7 +931,7 @@ ${rejected
}
private _handleRowClicked(ev: HASSDomEvent<RowClickedEvent>) {
const entry = this.entityRegistry.find((e) => e.entity_id === ev.detail.id);
const entry = this._entityReg.find((e) => e.entity_id === ev.detail.id);
if (entry) {
navigate(`/config/script/edit/${entry.unique_id}`);
} else {
@@ -950,9 +948,7 @@ ${rejected
}
private _runScript = async (script: any) => {
const entry = this.entityRegistry.find(
(e) => e.entity_id === script.entity_id
);
const entry = this._entityReg.find((e) => e.entity_id === script.entity_id);
if (!entry) {
return;
}
@@ -981,9 +977,7 @@ ${rejected
}
private _showTrace(script: any) {
const entry = this.entityRegistry.find(
(e) => e.entity_id === script.entity_id
);
const entry = this._entityReg.find((e) => e.entity_id === script.entity_id);
if (entry) {
navigate(`/config/script/trace/${entry.unique_id}`);
}
@@ -1009,7 +1003,7 @@ ${rejected
private async _duplicate(script: any) {
try {
const entry = this.entityRegistry.find(
const entry = this._entityReg.find(
(e) => e.entity_id === script.entity_id
);
if (!entry) {
@@ -1058,7 +1052,7 @@ ${rejected
private async _delete(script: any) {
try {
const entry = this.entityRegistry.find(
const entry = this._entityReg.find(
(e) => e.entity_id === script.entity_id
);
if (entry) {