mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-19 07:16:39 +00:00
Specify period when fetching statistics (#10040)
Co-authored-by: Bram Kragten <mail@bramkragten.nl>
This commit is contained in:
parent
cb11c6b3ea
commit
2240d019f5
@ -294,13 +294,15 @@ export const fetchStatistics = (
|
|||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
startTime: Date,
|
startTime: Date,
|
||||||
endTime?: Date,
|
endTime?: Date,
|
||||||
statistic_ids?: string[]
|
statistic_ids?: string[],
|
||||||
|
period: "hour" | "5minute" = "hour"
|
||||||
) =>
|
) =>
|
||||||
hass.callWS<Statistics>({
|
hass.callWS<Statistics>({
|
||||||
type: "history/statistics_during_period",
|
type: "history/statistics_during_period",
|
||||||
start_time: startTime.toISOString(),
|
start_time: startTime.toISOString(),
|
||||||
end_time: endTime?.toISOString(),
|
end_time: endTime?.toISOString(),
|
||||||
statistic_ids,
|
statistic_ids,
|
||||||
|
period,
|
||||||
});
|
});
|
||||||
|
|
||||||
export const calculateStatisticSumGrowth = (
|
export const calculateStatisticSumGrowth = (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user