Don't call deprecated history/* statistics API (#13658)

This commit is contained in:
Erik Montnemery 2022-09-08 22:03:35 +02:00 committed by GitHub
parent 462dee0351
commit 07b5856190
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -457,7 +457,7 @@ export const getStatisticIds = (
statistic_type?: "mean" | "sum" statistic_type?: "mean" | "sum"
) => ) =>
hass.callWS<StatisticsMetaData[]>({ hass.callWS<StatisticsMetaData[]>({
type: "history/list_statistic_ids", type: "recorder/list_statistic_ids",
statistic_type, statistic_type,
}); });
@ -478,7 +478,7 @@ export const fetchStatistics = (
period: "5minute" | "hour" | "day" | "month" = "hour" period: "5minute" | "hour" | "day" | "month" = "hour"
) => ) =>
hass.callWS<Statistics>({ hass.callWS<Statistics>({
type: "history/statistics_during_period", type: "recorder/statistics_during_period",
start_time: startTime.toISOString(), start_time: startTime.toISOString(),
end_time: endTime?.toISOString(), end_time: endTime?.toISOString(),
statistic_ids, statistic_ids,