2.0
Juraj Nyíri 3 years ago
parent 44c13c09c0
commit 6183f25d46

@ -20538,13 +20538,11 @@ class PlexMeetsHomeAssistant extends HTMLElement {
this.loading = true; this.loading = true;
this.renderPage(); this.renderPage();
try { try {
if (this.plex) { if (this.plex && this.hassObj) {
if (this.hassObj) {
this.playController = new PlayController(this.hassObj, this.plex, entity, this.runBefore, this.runAfter); this.playController = new PlayController(this.hassObj, this.plex, entity, this.runBefore, this.runAfter);
if (this.playController) { if (this.playController) {
await this.playController.init(); await this.playController.init();
} }
}
await this.plex.init(); await this.plex.init();
try { try {
const onDeck = await this.plex.getOnDeck(); const onDeck = await this.plex.getOnDeck();
@ -20620,7 +20618,9 @@ class PlexMeetsHomeAssistant extends HTMLElement {
this.render(); this.render();
} }
else { else {
throw Error('Plex not initialized.'); setTimeout(() => {
this.renderInitialData();
}, 250);
} }
} }
catch (err) { catch (err) {

@ -275,13 +275,11 @@ class PlexMeetsHomeAssistant extends HTMLElement {
this.loading = true; this.loading = true;
this.renderPage(); this.renderPage();
try { try {
if (this.plex) { if (this.plex && this.hassObj) {
if (this.hassObj) {
this.playController = new PlayController(this.hassObj, this.plex, entity, this.runBefore, this.runAfter); this.playController = new PlayController(this.hassObj, this.plex, entity, this.runBefore, this.runAfter);
if (this.playController) { if (this.playController) {
await this.playController.init(); await this.playController.init();
} }
}
await this.plex.init(); await this.plex.init();
try { try {
@ -355,7 +353,9 @@ class PlexMeetsHomeAssistant extends HTMLElement {
this.loading = false; this.loading = false;
this.render(); this.render();
} else { } else {
throw Error('Plex not initialized.'); setTimeout(() => {
this.renderInitialData();
}, 250);
} }
} catch (err) { } catch (err) {
this.error = `Plex server did not respond.<br/>Details of the error: ${escapeHtml(err.message)}`; this.error = `Plex server did not respond.<br/>Details of the error: ${escapeHtml(err.message)}`;

Loading…
Cancel
Save