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