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,
endTime?: Date,
statistic_ids?: string[],
period: "5minute" | "hour" | "day" | "month" = "hour",
period: "5minute" | "hour" | "day" | "week" | "month" = "hour",
units?: StatisticsUnitConfiguration
) =>
hass.callWS<Statistics>({

View File

@ -59,6 +59,7 @@ const cardConfigStruct = assign(
literal("5minute"),
literal("hour"),
literal("day"),
literal("week"),
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;
@customElement("hui-statistics-graph-card-editor")

View File

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