Tolerate numeric unique_ids.

This commit is contained in:
Dermot Duffy
2023-03-19 14:46:18 -07:00
parent f627747b2d
commit e3f544453e
3 changed files with 15 additions and 8 deletions
+4 -1
View File
@@ -7,7 +7,10 @@ export const entitySchema = z.object({
hidden_by: z.string().nullable(),
platform: z.string(),
translation_key: z.string().nullable(),
unique_id: z.string().optional(),
// Technically the unique_id should be a string, but we want to tolerate
// numeric unique_ids also in case they are used. See:
// https://github.com/dermotduffy/frigate-hass-card/issues/1016
unique_id: z.string().or(z.number()).optional(),
});
export type Entity = z.infer<typeof entitySchema>;