Add week period to statistics card (#14162)

This commit is contained in:
Michael 2022-10-25 22:36:20 +02:00 committed by GitHub
parent 0b18875d70
commit c12e6662dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 2 deletions

View File

@ -110,7 +110,7 @@ export const fetchStatistics = (
startTime: Date, startTime: Date,
endTime?: Date, endTime?: Date,
statistic_ids?: string[], statistic_ids?: string[],
period: "5minute" | "hour" | "day" | "month" = "hour", period: "5minute" | "hour" | "day" | "week" | "month" = "hour",
units?: StatisticsUnitConfiguration units?: StatisticsUnitConfiguration
) => ) =>
hass.callWS<Statistics>({ hass.callWS<Statistics>({

View File

@ -59,6 +59,7 @@ const cardConfigStruct = assign(
literal("5minute"), literal("5minute"),
literal("hour"), literal("hour"),
literal("day"), literal("day"),
literal("week"),
literal("month"), literal("month"),
]) ])
), ),
@ -67,7 +68,7 @@ const cardConfigStruct = assign(
}) })
); );
const periods = ["5minute", "hour", "day", "month"] as const; const periods = ["5minute", "hour", "day", "week", "month"] as const;
const stat_types = ["mean", "min", "max", "sum", "state"] as const; const stat_types = ["mean", "min", "max", "sum", "state"] as const;
@customElement("hui-statistics-graph-card-editor") @customElement("hui-statistics-graph-card-editor")

View File

@ -4020,6 +4020,7 @@
"hour": "Hour", "hour": "Hour",
"day": "Day", "day": "Day",
"month": "Month", "month": "Month",
"week": "Week",
"5minute": "5 Minutes" "5minute": "5 Minutes"
}, },
"pick_statistic": "Add a statistic", "pick_statistic": "Add a statistic",