Skip to content

Commit

Permalink
Remember hidden energy devices from storage (#24470)
Browse files Browse the repository at this point in the history
* Remember hidden devices from storage

* remove accidental

* typing fix
  • Loading branch information
karwosts authored Mar 5, 2025
1 parent b7be74e commit d899711
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/components/chart/ha-chart-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,16 @@ export class HaChartBase extends LitElement {
}
});
}

const legend = ensureArray(this.options?.legend || [])[0] as
| LegendComponentOption
| undefined;
Object.entries(legend?.selected || {}).forEach(([stat, selected]) => {
if (selected === false) {
this._hiddenDatasets.add(stat);
}
});

this.chart.setOption({
...this._createOptions(),
series: this._getSeries(),
Expand Down

0 comments on commit d899711

Please sign in to comment.