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:
Dermot Duffy
2024-09-22 15:08:37 -07:00
committed by GitHub
parent a4417e8a3d
commit 766f3422a9
20 changed files with 137 additions and 88 deletions
+11 -5
View File
@@ -113,11 +113,17 @@ export class ConfigManager {
if (!this._config) {
return;
}
const overriddenConfig = getOverriddenConfig(conditionsManager, this._config, {
configOverrides: this._config.overrides,
schema: frigateCardConfigSchema,
logOnParseError: !!this.getCardWideConfig()?.debug?.logging,
}) as FrigateCardConfig;
let overriddenConfig: FrigateCardConfig | null = null;
try {
overriddenConfig = getOverriddenConfig(conditionsManager, this._config, {
configOverrides: this._config.overrides,
schema: frigateCardConfigSchema,
});
} catch (ev) {
this._api.getMessageManager().setErrorIfHigherPriority(ev);
return;
}
// Save on Lit re-rendering costs by only updating the configuration if it
// actually changes.