Support executing actions from the query string.

This commit is contained in:
Dermot Duffy
2023-03-13 20:59:07 -07:00
parent ad22ee7e00
commit 292a8083d7
6 changed files with 209 additions and 11 deletions
+6
View File
@@ -205,6 +205,9 @@ const frigateCardCustomActionsBaseSchema = customActionSchema.extend({
// Syntactic sugar to avoid 'fire-dom-event' as part of an external API.
.transform((): 'fire-dom-event' => 'fire-dom-event')
.or(z.literal('fire-dom-event')),
// Card this command is intended for.
card_id: z.string().optional(),
});
const FRIGATE_CARD_GENERAL_ACTIONS = [
@@ -1316,6 +1319,9 @@ export const frigateCardConfigSchema = z.object({
// Support for card_mod (https://github.com/thomasloven/lovelace-card-mod).
card_mod: z.unknown(),
// Card ID (used for query string commands).
card_id: z.string().optional(),
// Stock lovelace card config.
type: z.string(),
test_gui: z.boolean().optional(),