Fix some localize key type errors in lovelace editors (#13403)

This commit is contained in:
Steve Repsher 2022-08-20 13:36:58 -04:00 committed by GitHub
parent 7e5cd9a1c8
commit 24509425ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 9 deletions

View File

@ -4,7 +4,7 @@ import { LovelaceHeaderFooterConfig } from "../../header-footer/types";
export const getHeaderFooterStubConfig = async (
hass: HomeAssistant,
type: string,
type: LovelaceHeaderFooterConfig["type"],
entities: string[],
entitiesFallback: string[]
): Promise<LovelaceHeaderFooterConfig> => {

View File

@ -64,7 +64,7 @@ export interface Card {
}
export interface HeaderFooter {
type: string;
type: LovelaceHeaderFooterConfig["type"];
icon?: string;
}
@ -75,7 +75,7 @@ export interface CardPickTarget extends EventTarget {
export interface SubElementEditorConfig {
index?: number;
elementConfig?: LovelaceRowConfig | LovelaceHeaderFooterConfig;
type: string;
type: "header" | "footer" | "row";
}
export interface EditSubElementEvent {

View File

@ -48,11 +48,13 @@ export class HuiViewEditor extends LitElement {
name: "type",
selector: {
select: {
options: [
DEFAULT_VIEW_LAYOUT,
SIDEBAR_VIEW_LAYOUT,
PANEL_VIEW_LAYOUT,
].map((type) => ({
options: (
[
DEFAULT_VIEW_LAYOUT,
SIDEBAR_VIEW_LAYOUT,
PANEL_VIEW_LAYOUT,
] as const
).map((type) => ({
value: type,
label: localize(
`ui.panel.lovelace.editor.edit_view.types.${type}`

View File

@ -2,7 +2,7 @@ import { ActionConfig } from "../../../data/lovelace";
import { EntitiesCardEntityConfig } from "../cards/types";
export interface LovelaceHeaderFooterConfig {
type: string;
type: "buttons" | "graph" | "picture";
}
export interface ButtonsHeaderFooterConfig extends LovelaceHeaderFooterConfig {