mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 09:46:36 +00:00
Keep area field next to use device area field (#16324)
This commit is contained in:
parent
8cf8c41698
commit
5cd3ce66f6
@ -608,11 +608,10 @@ export class EntityRegistrySettingsEditor extends LitElement {
|
||||
.disabled=${this.disabled}
|
||||
@input=${this._entityIdChanged}
|
||||
></ha-textfield>
|
||||
${!this.entry.device_id || this._areaId || this._noDeviceArea
|
||||
${!this.entry.device_id
|
||||
? html`<ha-area-picker
|
||||
.hass=${this.hass}
|
||||
.value=${this._areaId}
|
||||
.placeholder=${this._device?.area_id}
|
||||
.disabled=${this.disabled}
|
||||
@value-changed=${this._areaPicked}
|
||||
></ha-area-picker>`
|
||||
@ -794,40 +793,49 @@ export class EntityRegistrySettingsEditor extends LitElement {
|
||||
|
||||
${this.entry.device_id
|
||||
? html`<ha-settings-row>
|
||||
<span slot="heading"
|
||||
>${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
|
||||
})`
|
||||
: ""}</span
|
||||
>
|
||||
<span slot="description"
|
||||
>${this.hass.localize(
|
||||
"ui.dialogs.entity_registry.editor.change_device_settings",
|
||||
{
|
||||
link: html`<button
|
||||
class="link"
|
||||
@click=${this._openDeviceSettings}
|
||||
>
|
||||
${this.hass.localize(
|
||||
"ui.dialogs.entity_registry.editor.change_device_area_link"
|
||||
)}
|
||||
</button>`,
|
||||
}
|
||||
)}</span
|
||||
>
|
||||
<ha-switch
|
||||
.checked=${!this._areaId || this._noDeviceArea}
|
||||
.disabled=${this.disabled}
|
||||
@change=${this._useDeviceAreaChanged}
|
||||
>
|
||||
</ha-switch
|
||||
></ha-settings-row>`
|
||||
<span slot="heading"
|
||||
>${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
|
||||
})`
|
||||
: ""}</span
|
||||
>
|
||||
<span slot="description"
|
||||
>${this.hass.localize(
|
||||
"ui.dialogs.entity_registry.editor.change_device_settings",
|
||||
{
|
||||
link: html`<button
|
||||
class="link"
|
||||
@click=${this._openDeviceSettings}
|
||||
>
|
||||
${this.hass.localize(
|
||||
"ui.dialogs.entity_registry.editor.change_device_area_link"
|
||||
)}
|
||||
</button>`,
|
||||
}
|
||||
)}</span
|
||||
>
|
||||
<ha-switch
|
||||
.checked=${!this._areaId || this._noDeviceArea}
|
||||
.disabled=${this.disabled}
|
||||
@change=${this._useDeviceAreaChanged}
|
||||
>
|
||||
</ha-switch
|
||||
></ha-settings-row>
|
||||
${this._areaId || this._noDeviceArea
|
||||
? html`<ha-area-picker
|
||||
.hass=${this.hass}
|
||||
.value=${this._areaId}
|
||||
.placeholder=${this._device?.area_id}
|
||||
.disabled=${this.disabled}
|
||||
@value-changed=${this._areaPicked}
|
||||
></ha-area-picker>`
|
||||
: ""} `
|
||||
: ""}
|
||||
`;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user