From b77148e246e925e9d0074e26231c95efdb399a65 Mon Sep 17 00:00:00 2001 From: Marius Date: Tue, 3 Jul 2018 17:47:51 +0300 Subject: [PATCH] Added setConfig to make example work (#50) --- docs/lovelace_custom_card.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/lovelace_custom_card.md b/docs/lovelace_custom_card.md index 93579ef8..f5cc73b1 100644 --- a/docs/lovelace_custom_card.md +++ b/docs/lovelace_custom_card.md @@ -70,6 +70,13 @@ class ContentCardExample extends HTMLElement { `; } + setConfig(config) { + if (!config.entity) { + throw new Error('You need to define an entity'); + } + this.config = config; + } + // The height of your card. Home Assistant uses this to automatically // distribute all cards over the available columns. getCardSize() {