Don't try load_lovelace until it succeeds.

This commit is contained in:
2019-12-08 20:28:53 +01:00
parent ffc8d5fc2e
commit 9fcfff81c6
3 changed files with 10 additions and 4 deletions

View File

@@ -37,8 +37,14 @@ class BrowserMod {
window.browser_mod.playedOnce = true;
}
_load_lovelace() {
if(!load_lovelace()) {
let timer = window.setTimeout(this._load_lovelace.bind(this), 100);
}
}
constructor() {
window.setTimeout(load_lovelace, 500);
window.setTimeout(this._load_lovelace.bind(this), 500);
window.hassConnection.then((conn) => this.connect(conn.conn));
this.player = new Audio();
this.playedOnce = false;