I’m trying to create a card that renders cards but am running into an error where the cards I’m creating are throwing a setConfig is not a function error?
Here is my renderCard code:
private renderCard(card): LovelaceCard {
let tag = card.type;
if (tag.startsWith(this.CUSTOM_TYPE_PREFIX)) {
tag = tag.substr(this.CUSTOM_TYPE_PREFIX.length);
} else {
tag = `hui-${tag}-card`;
}
const cardElement = document.createElement(tag) as LovelaceCard;
cardElement.setConfig(card);
cardElement.hass = hass();
return cardElement;
}
I’m sure there’s an “official” way of rendering cards from the provided config, I just haven’t been able to find a suitable example.