mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-19 15:26:36 +00:00
Only draw weather chart when forecast is present (#239)
* Only draw weather chart when forecast is present * Update ha-weather-card.html * Update ha-weather-card.html
This commit is contained in:
parent
7b3a0aa5d6
commit
fe9b81fc67
@ -21,7 +21,7 @@
|
|||||||
<google-legacy-loader on-api-load='googleApiLoaded'></google-legacy-loader>
|
<google-legacy-loader on-api-load='googleApiLoaded'></google-legacy-loader>
|
||||||
<ha-card header='[[computeTitle(stateObj)]]'>
|
<ha-card header='[[computeTitle(stateObj)]]'>
|
||||||
<div class='content'>
|
<div class='content'>
|
||||||
<div id='chart_id'></div>
|
<div id='chart_id' hidden$="[[!stateObj.attributes.forecast]]"></div>
|
||||||
<ha-attributes state-obj='[[stateObj]]' extra-filters='forecast'></ha-attributes>
|
<ha-attributes state-obj='[[stateObj]]' extra-filters='forecast'></ha-attributes>
|
||||||
</div>
|
</div>
|
||||||
</ha-card>
|
</ha-card>
|
||||||
@ -83,6 +83,10 @@
|
|||||||
this.$.chart_id);
|
this.$.chart_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!this.stateObj.attributes || !this.stateObj.attributes.forecast) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this.drawChart();
|
this.drawChart();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user