Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
23 changes: 19 additions & 4 deletions src/panels/lovelace/cards/hui-entities-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,27 @@ class HuiEntitiesCard extends LitElement implements LovelaceCard {
if (!this._config || !this._hass) {
return html``;
}
const { show_header_toggle, title } = this._config;

return html`
<ha-card>
${!title && !show_header_toggle
${!this._config.title &&
!this._config.show_header_toggle &&
!this._config.icon
? html``
: html`
<div class="card-header">
<div class="name">${title}</div>
${show_header_toggle === false
<div class="name">
${this._config.icon
? html`
<ha-icon
class="icon"
.icon="${this._config.icon}"
></ha-icon>
`
: ""}
${this._config.title}
</div>
${this._config.show_header_toggle === false
? html``
: html`
<hui-entities-toggle
Expand Down Expand Up @@ -140,6 +151,10 @@ class HuiEntitiesCard extends LitElement implements LovelaceCard {
.state-card-dialog {
cursor: pointer;
}

.icon {
padding: 0px 18px 0px 8px;
}
`;
}

Expand Down
1 change: 1 addition & 0 deletions src/panels/lovelace/cards/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export interface EntitiesCardConfig extends LovelaceCardConfig {
title?: string;
entities: EntitiesCardEntityConfig[];
theme?: string;
icon?: string;
}

export interface EntityButtonCardConfig extends LovelaceCardConfig {
Expand Down