mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-18 23:06:40 +00:00
add icon option to entities card name (#4024)
* add icon option to entities card name * account for only icon * address comments
This commit is contained in:
parent
0a77728652
commit
fbee4937a0
@ -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
|
||||
@ -140,6 +151,10 @@ class HuiEntitiesCard extends LitElement implements LovelaceCard {
|
||||
.state-card-dialog {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.icon {
|
||||
padding: 0px 18px 0px 8px;
|
||||
}
|
||||
`;
|
||||
}
|
||||
|
||||
|
@ -35,6 +35,7 @@ export interface EntitiesCardConfig extends LovelaceCardConfig {
|
||||
title?: string;
|
||||
entities: EntitiesCardEntityConfig[];
|
||||
theme?: string;
|
||||
icon?: string;
|
||||
}
|
||||
|
||||
export interface EntityButtonCardConfig extends LovelaceCardConfig {
|
||||
|
Loading…
x
Reference in New Issue
Block a user