Allow syntactic sugar in config.
This commit is contained in:
@@ -103,6 +103,8 @@ const customActionSchema = z.object({
|
||||
action: z.literal('fire-dom-event'),
|
||||
})
|
||||
export const frigateCardCustomActionSchema = customActionSchema.merge(z.object({
|
||||
// Syntactic sugar to avoid 'fire-dom-event' as part of an external API.
|
||||
action: z.literal('fire-dom-event').or(z.literal('custom:frigate-card-action').transform(() => 'fire-dom-event')),
|
||||
frigate_card_action: z.string(),
|
||||
}))
|
||||
export type FrigateCardCustomAction = z.infer<typeof frigateCardCustomActionSchema>;
|
||||
|
||||
Reference in New Issue
Block a user