mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-21 16:26:43 +00:00
Honor entity ordering in statistics graph card (#16504)
This commit is contained in:
parent
450565799e
commit
ae8eafe8f9
@ -251,7 +251,7 @@ export class HuiStatisticsGraphCard extends LitElement implements LovelaceCard {
|
|||||||
: undefined;
|
: undefined;
|
||||||
}
|
}
|
||||||
const unitconfig = unitClass ? { [unitClass]: this._unit } : undefined;
|
const unitconfig = unitClass ? { [unitClass]: this._unit } : undefined;
|
||||||
this._statistics = await fetchStatistics(
|
const statistics = await fetchStatistics(
|
||||||
this.hass!,
|
this.hass!,
|
||||||
startDate,
|
startDate,
|
||||||
undefined,
|
undefined,
|
||||||
@ -260,6 +260,13 @@ export class HuiStatisticsGraphCard extends LitElement implements LovelaceCard {
|
|||||||
unitconfig,
|
unitconfig,
|
||||||
this._statTypes
|
this._statTypes
|
||||||
);
|
);
|
||||||
|
|
||||||
|
this._statistics = {};
|
||||||
|
this._entities.forEach((id) => {
|
||||||
|
if (id in statistics) {
|
||||||
|
this._statistics![id] = statistics[id];
|
||||||
|
}
|
||||||
|
});
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this._statistics = undefined;
|
this._statistics = undefined;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user