mirror of
https://github.com/home-assistant/frontend.git
synced 2025-12-20 02:38:53 +00:00
Hide energy usage chips when no title is set (#28464)
This commit is contained in:
@@ -88,8 +88,9 @@ export class HuiEnergyGasGraphCard
|
||||
|
||||
return html`
|
||||
<ha-card>
|
||||
<div class="card-header">
|
||||
<span>${this._config.title ? this._config.title : nothing}</span>
|
||||
${this._config.title
|
||||
? html` <div class="card-header">
|
||||
<span>${this._config.title}</span>
|
||||
${this._total
|
||||
? html`<hui-energy-graph-chip
|
||||
.tooltip=${this._formatTotal(this._total)}
|
||||
@@ -97,7 +98,8 @@ export class HuiEnergyGasGraphCard
|
||||
${formatNumber(this._total, this.hass.locale)} ${this._unit}
|
||||
</hui-energy-graph-chip>`
|
||||
: nothing}
|
||||
</div>
|
||||
</div>`
|
||||
: nothing}
|
||||
<div
|
||||
class="content ${classMap({
|
||||
"has-header": !!this._config.title,
|
||||
|
||||
@@ -90,8 +90,9 @@ export class HuiEnergySolarGraphCard
|
||||
|
||||
return html`
|
||||
<ha-card>
|
||||
<div class="card-header">
|
||||
<span>${this._config.title ? this._config.title : nothing}</span>
|
||||
${this._config.title
|
||||
? html` <div class="card-header">
|
||||
<span>${this._config.title}</span>
|
||||
${this._total
|
||||
? html`<hui-energy-graph-chip
|
||||
.tooltip=${this._formatTotal(this._total)}
|
||||
@@ -99,7 +100,8 @@ export class HuiEnergySolarGraphCard
|
||||
${formatNumber(this._total, this.hass.locale)} kWh
|
||||
</hui-energy-graph-chip>`
|
||||
: nothing}
|
||||
</div>
|
||||
</div>`
|
||||
: nothing}
|
||||
<div
|
||||
class="content ${classMap({
|
||||
"has-header": !!this._config.title,
|
||||
|
||||
@@ -103,8 +103,9 @@ export class HuiEnergyUsageGraphCard
|
||||
|
||||
return html`
|
||||
<ha-card>
|
||||
<div class="card-header">
|
||||
<span>${this._config.title ? this._config.title : nothing}</span>
|
||||
${this._config.title
|
||||
? html` <div class="card-header">
|
||||
<span>${this._config.title}</span>
|
||||
${this._total
|
||||
? html`<hui-energy-graph-chip
|
||||
.tooltip=${this._formatTotal(this._total)}
|
||||
@@ -115,7 +116,8 @@ export class HuiEnergyUsageGraphCard
|
||||
)}
|
||||
</hui-energy-graph-chip>`
|
||||
: nothing}
|
||||
</div>
|
||||
</div>`
|
||||
: nothing}
|
||||
<div
|
||||
class="content ${classMap({
|
||||
"has-header": !!this._config.title,
|
||||
|
||||
@@ -88,7 +88,8 @@ export class HuiEnergyWaterGraphCard
|
||||
|
||||
return html`
|
||||
<ha-card>
|
||||
<div class="card-header">
|
||||
${this._config.title
|
||||
? html` <div class="card-header">
|
||||
<span>${this._config.title ? this._config.title : nothing}</span>
|
||||
${this._total
|
||||
? html`<hui-energy-graph-chip
|
||||
@@ -97,7 +98,8 @@ export class HuiEnergyWaterGraphCard
|
||||
${formatNumber(this._total, this.hass.locale)} ${this._unit}
|
||||
</hui-energy-graph-chip>`
|
||||
: nothing}
|
||||
</div>
|
||||
</div>`
|
||||
: nothing}
|
||||
<div
|
||||
class="content ${classMap({
|
||||
"has-header": !!this._config.title,
|
||||
|
||||
Reference in New Issue
Block a user