|
|
@ -19699,7 +19699,7 @@ class PlexMeetsHomeAssistantEditor extends HTMLElement {
|
|
|
|
this.valueUpdated = () => {
|
|
|
|
this.valueUpdated = () => {
|
|
|
|
const originalConfig = lodash.clone(this.config);
|
|
|
|
const originalConfig = lodash.clone(this.config);
|
|
|
|
this.config.protocol = this.protocol.value;
|
|
|
|
this.config.protocol = this.protocol.value;
|
|
|
|
this.config.ip = this.ip.value;
|
|
|
|
this.config.ip = this.ip.value.replace(/^https?\:\/\//i, '').replace(/\/$/, '');
|
|
|
|
this.config.token = this.token.value;
|
|
|
|
this.config.token = this.token.value;
|
|
|
|
this.config.port = this.port.value;
|
|
|
|
this.config.port = this.port.value;
|
|
|
|
if (this.loaded) {
|
|
|
|
if (this.loaded) {
|
|
|
@ -19867,8 +19867,8 @@ class PlexMeetsHomeAssistantEditor extends HTMLElement {
|
|
|
|
this.protocol.value = this.config.protocol;
|
|
|
|
this.protocol.value = this.config.protocol;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.content.appendChild(this.protocol);
|
|
|
|
this.content.appendChild(this.protocol);
|
|
|
|
this.ip.label = 'Plex IP Address';
|
|
|
|
this.ip.label = 'Plex IP Address / Hostname';
|
|
|
|
this.ip.value = this.config.ip;
|
|
|
|
this.ip.value = this.config.ip.replace(/^https?\:\/\//i, '').replace(/\/$/, '');
|
|
|
|
this.ip.addEventListener('change', this.valueUpdated);
|
|
|
|
this.ip.addEventListener('change', this.valueUpdated);
|
|
|
|
this.content.appendChild(this.ip);
|
|
|
|
this.content.appendChild(this.ip);
|
|
|
|
this.port.label = 'Plex Port (Optional)';
|
|
|
|
this.port.label = 'Plex Port (Optional)';
|
|
|
@ -19898,7 +19898,7 @@ class PlexMeetsHomeAssistantEditor extends HTMLElement {
|
|
|
|
this.content.appendChild(this.libraryName);
|
|
|
|
this.content.appendChild(this.libraryName);
|
|
|
|
this.content.appendChild(warningLibrary);
|
|
|
|
this.content.appendChild(warningLibrary);
|
|
|
|
this.appendChild(this.content);
|
|
|
|
this.appendChild(this.content);
|
|
|
|
this.plex = new Plex(this.config.ip, this.plexPort, this.config.token, this.plexProtocol, this.config.sort);
|
|
|
|
this.plex = new Plex(this.config.ip.replace(/^https?\:\/\//i, '').replace(/\/$/, ''), this.plexPort, this.config.token, this.plexProtocol, this.config.sort);
|
|
|
|
this.sections = await this.plex.getSections();
|
|
|
|
this.sections = await this.plex.getSections();
|
|
|
|
this.livetv = await this.plex.getLiveTV();
|
|
|
|
this.livetv = await this.plex.getLiveTV();
|
|
|
|
this.collections = await this.plex.getCollections();
|
|
|
|
this.collections = await this.plex.getCollections();
|
|
|
|