From 5cd3ce66f6d73a4272390bd72e8407dba4eaba8e Mon Sep 17 00:00:00 2001 From: Paul Bottein Date: Wed, 26 Apr 2023 16:54:59 +0200 Subject: [PATCH] Keep area field next to use device area field (#16324) --- .../entity-registry-settings-editor.ts | 80 ++++++++++--------- 1 file changed, 44 insertions(+), 36 deletions(-) diff --git a/src/panels/config/entities/entity-registry-settings-editor.ts b/src/panels/config/entities/entity-registry-settings-editor.ts index 245b08bf41..c590ebcda4 100644 --- a/src/panels/config/entities/entity-registry-settings-editor.ts +++ b/src/panels/config/entities/entity-registry-settings-editor.ts @@ -608,11 +608,10 @@ export class EntityRegistrySettingsEditor extends LitElement { .disabled=${this.disabled} @input=${this._entityIdChanged} > - ${!this.entry.device_id || this._areaId || this._noDeviceArea + ${!this.entry.device_id ? html`` @@ -794,40 +793,49 @@ export class EntityRegistrySettingsEditor extends LitElement { ${this.entry.device_id ? html` - ${this.hass.localize( - "ui.dialogs.entity_registry.editor.use_device_area" - )} - ${this.hass.devices[this.entry.device_id].area_id - ? `(${ - this.hass.areas[ - this.hass.devices[this.entry.device_id].area_id! - ]?.name - })` - : ""} - ${this.hass.localize( - "ui.dialogs.entity_registry.editor.change_device_settings", - { - link: html``, - } - )} - - ` + ${this.hass.localize( + "ui.dialogs.entity_registry.editor.use_device_area" + )} + ${this.hass.devices[this.entry.device_id].area_id + ? `(${ + this.hass.areas[ + this.hass.devices[this.entry.device_id].area_id! + ]?.name + })` + : ""} + ${this.hass.localize( + "ui.dialogs.entity_registry.editor.change_device_settings", + { + link: html``, + } + )} + + + ${this._areaId || this._noDeviceArea + ? html`` + : ""} ` : ""} `; }