mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-27 03:06:41 +00:00
Fix devices graph max_devices (#25406)
This commit is contained in:
parent
8fc55cb6e2
commit
8a0d3baf67
@ -244,7 +244,10 @@ export class HuiEnergyDevicesGraphCard
|
|||||||
|
|
||||||
chartData.sort((a: any, b: any) => b.value[0] - a.value[0]);
|
chartData.sort((a: any, b: any) => b.value[0] - a.value[0]);
|
||||||
|
|
||||||
chartData.length = this._config?.max_devices || chartData.length;
|
chartData.length = Math.min(
|
||||||
|
this._config?.max_devices || Infinity,
|
||||||
|
chartData.length
|
||||||
|
);
|
||||||
|
|
||||||
this._chartData = datasets;
|
this._chartData = datasets;
|
||||||
await this.updateComplete;
|
await this.updateComplete;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user