fix: hide graph loading indicator when appropriate (#1197)

This commit is contained in:
ildar170975
2025-01-13 03:57:37 +03:00
committed by GitHub
parent 9f5cfd9c86
commit d708d6a22f
2 changed files with 7 additions and 2 deletions

View File

@@ -169,6 +169,8 @@ All properties are optional.
| labels_secondary | `hover` | `true` / `false` / `hover` | Display secondary Y-axis labels.
| name_adaptive_color | `false` | `true` / `false` | Make the name color adapt with the primary entity color.
| icon_adaptive_color | `false` | `true` / `false` | Make the icon color adapt with the primary entity color.
| loading_indicator | `true` | `true` / `false` | Show loading indicator while attempting to retrieve a history.
#### Line color object
See [dynamic line color](#dynamic-line-color) for example usage.

View File

@@ -323,8 +323,11 @@ class MiniGraphCard extends LitElement {
}
renderGraph() {
const ready = this.entity[0] && this.Graph[0]._history !== undefined;
const ready = (this.entity[0] && !this.Graph.some(
(element, index) => element._history === undefined
&& this.config.entities[index].show_graph !== false,
))
|| this.config.show.loading_indicator === false;
return this.config.show.graph ? html`
<div class="graph">
${ready ? html`