fix: Unparseable config when using the low-performance profile (#1570)
* The `low-performance` profile itself had parse errors: fix them! * Do not silently swallow override parse errors, they are always a user issue * Minor error message rendering improvements to show multiple pieces of context
This commit is contained in:
+9
-3
@@ -81,12 +81,18 @@ export const createCondition = (
|
||||
return frigateCardConditionSchema.parse(condition ?? {});
|
||||
};
|
||||
|
||||
export const createConfig = (config?: RawFrigateCardConfig): FrigateCardConfig => {
|
||||
return frigateCardConfigSchema.parse({
|
||||
export const createRawConfig = (
|
||||
config?: Partial<RawFrigateCardConfig>,
|
||||
): RawFrigateCardConfig => {
|
||||
return {
|
||||
type: 'frigate-hass-card',
|
||||
cameras: [{}],
|
||||
...config,
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
export const createConfig = (config?: RawFrigateCardConfig): FrigateCardConfig => {
|
||||
return frigateCardConfigSchema.parse(createRawConfig(config));
|
||||
};
|
||||
|
||||
export const createCamera = (
|
||||
|
||||
Reference in New Issue
Block a user