Only show own devices when there are devices... (#25920)

only show own devices when there are devices...
This commit is contained in:
Bram Kragten 2025-06-25 23:31:43 +02:00 committed by GitHub
parent df2523a6a2
commit eb9359e9e1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 47 additions and 41 deletions

View File

@ -405,47 +405,52 @@ 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-icon-button <ha-md-list-item
class="expand-button" @click=${this._toggleOwnDevices}
.path=${this._devicesExpanded type="button"
? mdiChevronDown
: mdiChevronUp}
slot="start"
> >
</ha-icon-button> <ha-icon-button
${this.hass.localize( class="expand-button"
"ui.panel.config.integrations.config_entry.devices_without_subentry" .path=${this._devicesExpanded
)} ? mdiChevronDown
</ha-md-list-item> : mdiChevronUp}
${this._devicesExpanded slot="start"
? ownDevices.map( >
(device) => </ha-icon-button>
html`<ha-config-entry-device-row ${this.hass.localize(
.hass=${this.hass} "ui.panel.config.integrations.config_entry.devices_without_subentry"
.narrow=${this.narrow} )}
.entry=${item} </ha-md-list-item>
.device=${device} ${this._devicesExpanded
.entities=${entities} ? ownDevices.map(
></ha-config-entry-device-row>` (device) =>
) html`<ha-config-entry-device-row
: nothing} .hass=${this.hass}
</ha-md-list> .narrow=${this.narrow}
${subEntries.map( .entry=${item}
(subEntry) => html` .device=${device}
<ha-config-sub-entry-row .entities=${entities}
.hass=${this.hass} ></ha-config-entry-device-row>`
.narrow=${this.narrow} )
.manifest=${this.manifest} : nothing}
.diagnosticHandler=${this.diagnosticHandler} </ha-md-list>`
.entities=${this.entities} : nothing}
.entry=${item} ${subEntries.map(
.subEntry=${subEntry} (subEntry) => html`
data-entry-id=${item.entry_id} <ha-config-sub-entry-row
></ha-config-sub-entry-row> .hass=${this.hass}
` .narrow=${this.narrow}
)}` .manifest=${this.manifest}
.diagnosticHandler=${this.diagnosticHandler}
.entities=${this.entities}
.entry=${item}
.subEntry=${subEntry}
data-entry-id=${item.entry_id}
></ha-config-sub-entry-row>
`
)}`
: html` : html`
${ownDevices.map( ${ownDevices.map(
(device) => (device) =>

View File

@ -541,8 +541,9 @@ class HaConfigIntegrationPage extends SubscribeMixin(LitElement) {
<ha-button <ha-button
slot="action" slot="action"
@click=${this._handleDisableDebugLogging} @click=${this._handleDisableDebugLogging}
>${this.hass.localize("ui.common.disable")}</ha-button
> >
${this.hass.localize("ui.common.disable")}
</ha-button>
</ha-alert> </ha-alert>
</div>` </div>`
: nothing} : nothing}