mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-28 03:36:44 +00:00
Add 'max devices' config to Energy Devices Graph (#17553)
This commit is contained in:
parent
86c014b677
commit
4a5b67e320
@ -278,6 +278,8 @@ export class HuiEnergyDevicesGraphCard
|
||||
|
||||
chartData.sort((a, b) => b.x - a.x);
|
||||
|
||||
chartData.length = this._config?.max_devices || chartData.length;
|
||||
|
||||
chartData.forEach((d: any) => {
|
||||
const color = getColorByIndex(d.idx);
|
||||
|
||||
|
@ -153,6 +153,7 @@ export interface EnergyDevicesGraphCardConfig extends LovelaceCardConfig {
|
||||
type: "energy-devices-graph";
|
||||
title?: string;
|
||||
collection_key?: string;
|
||||
max_devices?: number;
|
||||
}
|
||||
|
||||
export interface EnergySourcesTableCardConfig extends LovelaceCardConfig {
|
||||
|
Loading…
x
Reference in New Issue
Block a user