refactor: Centralize template render type assertion (#2538)

This commit is contained in:
Dermot Duffy
2026-06-30 17:45:13 -07:00
committed by dermotduffy
parent a31816c168
commit 5572ec728e
5 changed files with 44 additions and 16 deletions
+7 -3
View File
@@ -136,9 +136,13 @@ export class AdvancedCameraCardElementsCore extends LitElement {
return;
}
const elements = this._templateRenderer.renderRecursively(this.hass, this.elements, {
conditionState: this.conditionStateManager?.getState(),
}) as PictureElements | undefined;
const elements = this._templateRenderer.renderRecursivelyAsType(
this.hass,
this.elements,
{
conditionState: this.conditionStateManager?.getState(),
},
);
// Condition state changes won't change the actual rendered config unless
// `elements` has a template, which is more likely does not. Avoid updating