mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 01:36:49 +00:00
Do not render info tooltip if we have an error (#9869)
This commit is contained in:
parent
e963735dba
commit
bd8f436c1d
@ -124,16 +124,17 @@ class HuiEnergyCarbonGaugeCard
|
|||||||
|
|
||||||
return html`
|
return html`
|
||||||
<ha-card>
|
<ha-card>
|
||||||
<ha-svg-icon id="info" .path=${mdiInformation}></ha-svg-icon>
|
|
||||||
<paper-tooltip animation-delay="0" for="info" position="left">
|
|
||||||
<span>
|
|
||||||
This card represents how much of the energy consumed by your home
|
|
||||||
was generated using non-fossil fuels like solar, wind and nuclear.
|
|
||||||
</span>
|
|
||||||
</paper-tooltip>
|
|
||||||
|
|
||||||
${value !== undefined
|
${value !== undefined
|
||||||
? html` <ha-gauge
|
? html`
|
||||||
|
<ha-svg-icon id="info" .path=${mdiInformation}></ha-svg-icon>
|
||||||
|
<paper-tooltip animation-delay="0" for="info" position="left">
|
||||||
|
<span>
|
||||||
|
This card represents how much of the energy consumed by your
|
||||||
|
home was generated using non-fossil fuels like solar, wind and
|
||||||
|
nuclear.
|
||||||
|
</span>
|
||||||
|
</paper-tooltip>
|
||||||
|
<ha-gauge
|
||||||
min="0"
|
min="0"
|
||||||
max="100"
|
max="100"
|
||||||
.value=${value}
|
.value=${value}
|
||||||
@ -143,7 +144,8 @@ class HuiEnergyCarbonGaugeCard
|
|||||||
"--gauge-color": this._computeSeverity(value),
|
"--gauge-color": this._computeSeverity(value),
|
||||||
})}
|
})}
|
||||||
></ha-gauge>
|
></ha-gauge>
|
||||||
<div class="name">Non-fossil energy consumed</div>`
|
<div class="name">Non-fossil energy consumed</div>
|
||||||
|
`
|
||||||
: html`Consumed non-fossil energy couldn't be calculated`}
|
: html`Consumed non-fossil energy couldn't be calculated`}
|
||||||
</ha-card>
|
</ha-card>
|
||||||
`;
|
`;
|
||||||
|
@ -97,18 +97,20 @@ class HuiEnergyGridGaugeCard
|
|||||||
|
|
||||||
return html`
|
return html`
|
||||||
<ha-card>
|
<ha-card>
|
||||||
<ha-svg-icon id="info" .path=${mdiInformation}></ha-svg-icon>
|
|
||||||
<paper-tooltip animation-delay="0" for="info" position="left">
|
|
||||||
<span>
|
|
||||||
This card represents your energy dependency.
|
|
||||||
<br /><br />
|
|
||||||
If it's green, it means you produced more energy than that you
|
|
||||||
consumed from the grid. If it's in the red, it means that you relied
|
|
||||||
on the grid for part of your home's energy consumption.
|
|
||||||
</span>
|
|
||||||
</paper-tooltip>
|
|
||||||
${value !== undefined
|
${value !== undefined
|
||||||
? html`<ha-gauge
|
? html`
|
||||||
|
<ha-svg-icon id="info" .path=${mdiInformation}></ha-svg-icon>
|
||||||
|
<paper-tooltip animation-delay="0" for="info" position="left">
|
||||||
|
<span>
|
||||||
|
This card represents your energy dependency.
|
||||||
|
<br /><br />
|
||||||
|
If it's green, it means you produced more energy than that you
|
||||||
|
consumed from the grid. If it's in the red, it means that you
|
||||||
|
relied on the grid for part of your home's energy consumption.
|
||||||
|
</span>
|
||||||
|
</paper-tooltip>
|
||||||
|
|
||||||
|
<ha-gauge
|
||||||
min="-1"
|
min="-1"
|
||||||
max="1"
|
max="1"
|
||||||
.value=${value}
|
.value=${value}
|
||||||
@ -126,7 +128,8 @@ class HuiEnergyGridGaugeCard
|
|||||||
${returnedToGrid! >= consumedFromGrid!
|
${returnedToGrid! >= consumedFromGrid!
|
||||||
? "Net returned to the grid"
|
? "Net returned to the grid"
|
||||||
: "Net consumed from the grid"}
|
: "Net consumed from the grid"}
|
||||||
</div>`
|
</div>
|
||||||
|
`
|
||||||
: "Grid neutrality could not be calculated"}
|
: "Grid neutrality could not be calculated"}
|
||||||
</ha-card>
|
</ha-card>
|
||||||
`;
|
`;
|
||||||
|
@ -86,19 +86,20 @@ class HuiEnergySolarGaugeCard
|
|||||||
|
|
||||||
return html`
|
return html`
|
||||||
<ha-card>
|
<ha-card>
|
||||||
<ha-svg-icon id="info" .path=${mdiInformation}></ha-svg-icon>
|
|
||||||
<paper-tooltip animation-delay="0" for="info" position="left">
|
|
||||||
<span>
|
|
||||||
This card represents how much of the solar energy was used by your
|
|
||||||
home and was not returned to the grid.
|
|
||||||
<br /><br />
|
|
||||||
If you frequently produce more than you consume, try to conserve
|
|
||||||
this energy by installing a battery or buying an electric car to
|
|
||||||
charge.
|
|
||||||
</span>
|
|
||||||
</paper-tooltip>
|
|
||||||
${value !== undefined
|
${value !== undefined
|
||||||
? html`<ha-gauge
|
? html`
|
||||||
|
<ha-svg-icon id="info" .path=${mdiInformation}></ha-svg-icon>
|
||||||
|
<paper-tooltip animation-delay="0" for="info" position="left">
|
||||||
|
<span>
|
||||||
|
This card represents how much of the solar energy was used by
|
||||||
|
your home and was not returned to the grid.
|
||||||
|
<br /><br />
|
||||||
|
If you frequently produce more than you consume, try to
|
||||||
|
conserve this energy by installing a battery or buying an
|
||||||
|
electric car to charge.
|
||||||
|
</span>
|
||||||
|
</paper-tooltip>
|
||||||
|
<ha-gauge
|
||||||
min="0"
|
min="0"
|
||||||
max="100"
|
max="100"
|
||||||
.value=${value}
|
.value=${value}
|
||||||
@ -108,7 +109,8 @@ class HuiEnergySolarGaugeCard
|
|||||||
"--gauge-color": this._computeSeverity(value),
|
"--gauge-color": this._computeSeverity(value),
|
||||||
})}
|
})}
|
||||||
></ha-gauge>
|
></ha-gauge>
|
||||||
<div class="name">Self consumed solar energy</div>`
|
<div class="name">Self consumed solar energy</div>
|
||||||
|
`
|
||||||
: totalSolarProduction === 0
|
: totalSolarProduction === 0
|
||||||
? "You have not produced any solar energy"
|
? "You have not produced any solar energy"
|
||||||
: "Self consumed solar energy couldn't be calculated"}
|
: "Self consumed solar energy couldn't be calculated"}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user