Implement selectBestViewForNonFrigateCameras
This commit is contained in:
+5
-5
@@ -36,12 +36,12 @@ export class View {
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines whether a view is supported on non-Frigate cameras.
|
||||
* @param view The view to determine support for.
|
||||
* @returns Whether the view is supported by non-Frigate cameras.
|
||||
* Selects the best view for a non-Frigate camera.
|
||||
* @param view The wanted view.
|
||||
* @returns The closest view supported by the non-Frigate camera.
|
||||
*/
|
||||
public static supportsNonFrigateCameras(view: FrigateCardView): boolean {
|
||||
return ['timeline', 'image', 'live'].includes(view);
|
||||
public static selectBestViewForNonFrigateCameras(view: FrigateCardView) {
|
||||
return ['timeline', 'image'].includes(view) ? view : 'live';
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user