Initial card editor.

This commit is contained in:
Dermot Duffy
2021-08-14 13:55:15 -07:00
parent 3c795ff75e
commit f8085c116b
3 changed files with 88 additions and 123 deletions
+3 -2
View File
@@ -1,5 +1,5 @@
import { ActionConfig, LovelaceCard, LovelaceCardConfig, LovelaceCardEditor } from 'custom-card-helpers';
import { z } from "zod";
import { number, z } from "zod";
declare global {
interface HTMLElementTagNameMap {
@@ -18,7 +18,8 @@ export const frigateCardConfigSchema = z.object({
frigate_url: z.string().url(),
frigate_camera_name: z.string().optional(),
view_default: z.enum(["live", "clips", "clip", "snapshots", "snapshot"]).optional().default("live"),
view_timeout: z.number().optional(),
view_timeout: z.number().or(z.string().regex(/^\d+$/).transform(val => Number(val))),
live_provider: z.enum(["frigate", "webrtc"]).default("frigate"),
webrtc: z.object({}).passthrough().optional(),
label: z.string().optional(),