Add support for pre-defined zoom/pan settings.

This commit is contained in:
Dermot Duffy
2024-04-27 14:55:38 -07:00
parent 246dd7ff54
commit 7917e5c537
59 changed files with 1981 additions and 638 deletions
+21
View File
@@ -102,6 +102,27 @@ export function createFrigateCardShowPTZAction(
};
}
export function createFrigateCardChangeZoomAction(
targetID: string,
options?: {
cardID?: string;
pan?: {
x?: number;
y?: number;
};
zoom?: number;
},
): FrigateCardCustomAction {
return {
action: 'fire-dom-event',
frigate_card_action: 'change_zoom',
target_id: targetID,
...(options?.cardID && { card_id: options.cardID }),
...(options?.pan && { pan: options.pan }),
...(options?.zoom && { zoom: options.zoom }),
};
}
/**
* Get an action configuration given a config and an interaction (e.g. 'tap').
* @param interaction The interaction: `tap`, `hold` or `double_tap`