Remember hidden energy devices from storage (#24470)

* Remember hidden devices from storage

* remove accidental

* typing fix
This commit is contained in:
karwosts 2025-03-05 01:38:13 -08:00 committed by GitHub
parent b7be74e722
commit d899711a48
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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(),