Update for Home Assistant 0.86

This commit is contained in:
Thomas Lovén 2019-01-25 13:28:43 +01:00
parent a97cc8521b
commit fac69b57fa

View File

@ -1,3 +1,4 @@
customElements.whenDefined('card-tools').then(() => {
class LayoutCard extends Polymer.Element {
static get template() {
@ -27,8 +28,7 @@ class LayoutCard extends Polymer.Element {
}
setConfig(config) {
if(!window.cardTools) throw new Error(`Can't find card-tools. See https://github.com/thomasloven/lovelace-card-tools`);
window.cardTools.checkVersion(0.1);
cardTools.checkVersion(0.1);
this.config = config;
@ -161,3 +161,11 @@ class LayoutCard extends Polymer.Element {
}
customElements.define('layout-card', LayoutCard);
});
window.setTimeout(() => {
if(customElements.get('card-tools')) return;
customElements.define('layout-card', class extends HTMLElement{
setConfig() { throw new Error("Can't find card-tools. See https://github.com/thomasloven/lovelace-card-tools");}
});
}, 2000);