Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix visibility for shown entities on device card #22579

Draft
wants to merge 4 commits into
base: dev
Choose a base branch
from
Draft
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 20 additions & 9 deletions src/panels/config/devices/device-detail/ha-device-entities-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,19 @@ export class HaDeviceEntitiesCard extends LitElement {

return html`
<ha-card outlined .header=${this.header}>
<div id="entities">
<mwc-list>
${shownEntities.map((entry) =>
this.hass.states[entry.entity_id]
? this._renderEntity(entry)
: this._renderEntry(entry)
)}
</mwc-list>
</div>
${shownEntities.length
? html`
<div id="entities">
<mwc-list>
${shownEntities.map((entry) =>
this.hass.states[entry.entity_id]
? this._renderEntity(entry)
: this._renderEntry(entry)
)}
</mwc-list>
</div>
`
: ""}
ildar170975 marked this conversation as resolved.
Show resolved Hide resolved
${hiddenEntities.length
? !this.showHidden
? html`
Expand Down Expand Up @@ -302,6 +306,13 @@ export class HaDeviceEntitiesCard extends LitElement {
outline: none;
text-decoration: underline;
}
mwc-list:has(.disabled-entry) {
--mdc-list-vertical-padding: 0;
margin-top: -8px;
}
#entities + mwc-list:has(.disabled-entry) {
margin-top: 8px;
}
`;
}
}
Expand Down
Loading