Hide devices without subentry box when not needed

This commit is contained in:
Paulus Schoutsen 2025-06-25 21:20:10 +00:00
parent df2523a6a2
commit a6452bbf35

View File

@ -405,8 +405,13 @@ class HaConfigEntryRow extends LitElement {
</ha-md-list-item> </ha-md-list-item>
${this._expanded ${this._expanded
? subEntries.length ? subEntries.length
? html`<ha-md-list class="devices"> ? html` ${ownDevices.length
<ha-md-list-item @click=${this._toggleOwnDevices} type="button"> ? html`
<ha-md-list class="devices">
<ha-md-list-item
@click=${this._toggleOwnDevices}
type="button"
>
<ha-icon-button <ha-icon-button
class="expand-button" class="expand-button"
.path=${this._devicesExpanded .path=${this._devicesExpanded
@ -432,6 +437,8 @@ class HaConfigEntryRow extends LitElement {
) )
: nothing} : nothing}
</ha-md-list> </ha-md-list>
`
: nothing}
${subEntries.map( ${subEntries.map(
(subEntry) => html` (subEntry) => html`
<ha-config-sub-entry-row <ha-config-sub-entry-row