From c1855043dd2b5e9dd524a4b92f9565f793753359 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Mon, 5 Oct 2020 13:45:13 +0200 Subject: [PATCH] Update weather-card-editor.js --- dist/weather-card-editor.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/dist/weather-card-editor.js b/dist/weather-card-editor.js index 254c6ef2..10733239 100644 --- a/dist/weather-card-editor.js +++ b/dist/weather-card-editor.js @@ -22,10 +22,7 @@ const LitElement = customElements.get("hui-masonry-view") ? Object.getPrototypeO const html = LitElement.prototype.html; const css = LitElement.prototype.css; -const helpers = await loadCardHelpers(); -if (helpers.importMoreInfoControl) { - helpers.importMoreInfoControl("fan"); -} +const HELPERS = window.loadCardHelpers(); export class WeatherCardEditor extends LitElement { setConfig(config) { @@ -68,6 +65,14 @@ export class WeatherCardEditor extends LitElement { return this._config.number_of_forecasts || 5; } + firstUpdated() { + HELPERS.then(help => { + if (help.importMoreInfoControl) { + help.importMoreInfoControl("fan"); + } + }) + } + render() { if (!this.hass) { return html``;