diff --git a/src/panels/config/entities/dialog-entity-editor.ts b/src/panels/config/entities/dialog-entity-editor.ts index bd9790ab09..5d1636c3d8 100644 --- a/src/panels/config/entities/dialog-entity-editor.ts +++ b/src/panels/config/entities/dialog-entity-editor.ts @@ -170,6 +170,7 @@ export class DialogEntityEditor extends LitElement { } return html`
+
Entity ID: ${this._params!.entity_id}
${this.hass.localize("ui.dialogs.entity_registry.no_unique_id")}
`; @@ -193,9 +194,12 @@ export class DialogEntityEditor extends LitElement { this.hass, this._params!.entity_id ); + console.log(this._entry); + this._loadPlatformSettingTabs(); } catch { - this._entry = null; + this._entry = { entity_id: this._params!.entity_id }; + this._loadPlatformSettingTabs(); } } diff --git a/src/panels/config/entities/entity-registry-settings.ts b/src/panels/config/entities/entity-registry-settings.ts index 5ac897dc78..e18cada8e5 100644 --- a/src/panels/config/entities/entity-registry-settings.ts +++ b/src/panels/config/entities/entity-registry-settings.ts @@ -6,14 +6,15 @@ import { CSSResult, customElement, html, + internalProperty, LitElement, property, - internalProperty, PropertyValues, TemplateResult, } from "lit-element"; import { fireEvent } from "../../../common/dom/fire_event"; import { computeDomain } from "../../../common/entity/compute_domain"; +import { domainIcon } from "../../../common/entity/domain_icon"; import "../../../components/ha-icon-input"; import "../../../components/ha-switch"; import type { HaSwitch } from "../../../components/ha-switch"; @@ -86,15 +87,18 @@ export class EntityRegistrySettings extends LitElement { .value=${this._name} @value-changed=${this._nameChanged} .label=${this.hass.localize("ui.dialogs.entity_registry.editor.name")} - .placeholder=${this.entry.original_name} - .disabled=${this._submitting} + .placeholder=${this.entry.original_name || + stateObj.attributes.friendly_name} + .disabled=${this._submitting || !this.entry.config_entry_id} > -
- - -
-
- ${this.hass.localize( - "ui.dialogs.entity_registry.editor.enabled_label" - )} -
-
- ${this._disabledBy && this._disabledBy !== "user" - ? this.hass.localize( - "ui.dialogs.entity_registry.editor.enabled_cause", - "cause", - this.hass.localize( - `config_entry.disabled_by.${this._disabledBy}` - ) - ) - : ""} - ${this.hass.localize( - "ui.dialogs.entity_registry.editor.enabled_description" - )} -
${this.hass.localize( - "ui.dialogs.entity_registry.editor.note" - )} -
-
-
+ ${this.entry.config_entry_id + ? html` +
+ + +
+
+ ${this.hass.localize( + "ui.dialogs.entity_registry.editor.enabled_label" + )} +
+
+ ${this._disabledBy && this._disabledBy !== "user" + ? this.hass.localize( + "ui.dialogs.entity_registry.editor.enabled_cause", + "cause", + this.hass.localize( + `config_entry.disabled_by.${this._disabledBy}` + ) + ) + : ""} + ${this.hass.localize( + "ui.dialogs.entity_registry.editor.enabled_description" + )} +
${this.hass.localize( + "ui.dialogs.entity_registry.editor.note" + )} +
+
+
+ ` + : ""}
${this.hass.localize("ui.dialogs.entity_registry.editor.delete")} ${this.hass.localize("ui.dialogs.entity_registry.editor.update")}