Initial support for grid for live and media viewer.
This commit is contained in:
@@ -11,6 +11,7 @@ import {
|
||||
FrigateCardCustomAction,
|
||||
frigateCardCustomActionSchema,
|
||||
FrigateCardViewAction,
|
||||
ViewDisplayMode,
|
||||
} from '../types.js';
|
||||
|
||||
/**
|
||||
@@ -42,6 +43,7 @@ export function createFrigateCardCustomAction(
|
||||
camera?: string;
|
||||
media_player?: string;
|
||||
media_player_action?: 'play' | 'stop';
|
||||
display_mode?: ViewDisplayMode;
|
||||
},
|
||||
): FrigateCardCustomAction | null {
|
||||
if (action === 'camera_select' || action === 'live_substream_select') {
|
||||
@@ -67,6 +69,17 @@ export function createFrigateCardCustomAction(
|
||||
...(args.cardID && { card_id: args.cardID }),
|
||||
};
|
||||
}
|
||||
if (action === 'display_mode_select') {
|
||||
if (!args?.display_mode) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
action: 'fire-dom-event',
|
||||
frigate_card_action: action,
|
||||
display_mode: args?.display_mode,
|
||||
...(args.cardID && { card_id: args.cardID }),
|
||||
};
|
||||
}
|
||||
return {
|
||||
action: 'fire-dom-event',
|
||||
frigate_card_action: action,
|
||||
|
||||
Reference in New Issue
Block a user