From 060e67397abdcc0fcad3aeea3fdc7f14968ab728 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Fri, 4 Aug 2023 15:09:20 +0200 Subject: [PATCH] Prevent voice settings to override entity registry settings dialog (#17485) --- src/dialogs/more-info/ha-more-info-dialog.ts | 96 +++++++++---------- .../entity-registry-settings-editor.ts | 5 +- 2 files changed, 52 insertions(+), 49 deletions(-) diff --git a/src/dialogs/more-info/ha-more-info-dialog.ts b/src/dialogs/more-info/ha-more-info-dialog.ts index 748d51d1c0..080d10cb1e 100644 --- a/src/dialogs/more-info/ha-more-info-dialog.ts +++ b/src/dialogs/more-info/ha-more-info-dialog.ts @@ -411,54 +411,54 @@ export class MoreInfoDialog extends LitElement { @entity-entry-updated=${this._entryUpdated} @toggle-edit-mode=${this._handleToggleInfoEditModeEvent} > - ${this._childView - ? html` -
- ${dynamicElement(this._childView.viewTag, { - hass: this.hass, - entry: this._entry, - params: this._childView.viewParams, - })} -
- ` - : cache( - this._currView === "info" - ? html` - - ` - : this._currView === "history" - ? html` - - ` - : this._currView === "settings" - ? html` - - ` - : this._currView === "related" - ? html` - - ` - : nothing - )} + ${cache( + this._childView + ? html` +
+ ${dynamicElement(this._childView.viewTag, { + hass: this.hass, + entry: this._entry, + params: this._childView.viewParams, + })} +
+ ` + : this._currView === "info" + ? html` + + ` + : this._currView === "history" + ? html` + + ` + : this._currView === "settings" + ? html` + + ` + : this._currView === "related" + ? html` + + ` + : nothing + )} `; diff --git a/src/panels/config/entities/entity-registry-settings-editor.ts b/src/panels/config/entities/entity-registry-settings-editor.ts index 940ea5de59..593a6d417f 100644 --- a/src/panels/config/entities/entity-registry-settings-editor.ts +++ b/src/panels/config/entities/entity-registry-settings-editor.ts @@ -186,7 +186,10 @@ export class EntityRegistrySettingsEditor extends LitElement { protected willUpdate(changedProperties: PropertyValues) { super.willUpdate(changedProperties); - if (!changedProperties.has("entry")) { + if ( + !changedProperties.has("entry") || + changedProperties.get("entry")?.id === this.entry.id + ) { return; }