Dynamically extract dimensions from loaded media.
This commit is contained in:
+15
-1
@@ -97,6 +97,15 @@ export const frigateCardConfigSchema = z.object({
|
||||
nextprev: z.enum(NEXT_PREVIOUS_CONTROL_STYLES).default('thumbnails'),
|
||||
})
|
||||
.optional(),
|
||||
dimensions: z.object({
|
||||
aspect_ratio_mode: z.enum(['dynamic', 'static']).default('dynamic'),
|
||||
aspect_ratio:
|
||||
z.number().array().length(2).or(
|
||||
z.string()
|
||||
.regex(/^\s*\d+\s*\/\s*\d+\s*$/)
|
||||
.transform((input) => input.split("/").map((d) => Number(d)))
|
||||
).default([16, 9]),
|
||||
}).optional(),
|
||||
|
||||
// Stock lovelace card config.
|
||||
type: z.string(),
|
||||
@@ -126,8 +135,13 @@ export interface BrowseMediaQueryParameters {
|
||||
after?: number;
|
||||
}
|
||||
|
||||
export interface MediaLoadInfo {
|
||||
width: number;
|
||||
height: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Media Browser API types.
|
||||
* Home Assistant API types.
|
||||
*/
|
||||
|
||||
// Recursive type, cannot use type interference:
|
||||
|
||||
Reference in New Issue
Block a user