2.0
Juraj Nyíri 3 years ago
parent cb9f0cbab0
commit f2a870cc50

@ -19468,6 +19468,7 @@ class PlexMeetsHomeAssistantEditor extends HTMLElement {
this.sections = [];
this.entitiesRegistry = false;
this.plexValidSection = document.createElement('div');
this.loaded = false;
this.fireEvent = (node, type, detail, options = {}) => {
// eslint-disable-next-line no-param-reassign
detail = detail === null || detail === undefined ? {} : detail;
@ -19481,6 +19482,7 @@ class PlexMeetsHomeAssistantEditor extends HTMLElement {
return event;
};
this.valueUpdated = () => {
if (this.loaded) {
const originalConfig = lodash.clone(this.config);
this.config.protocol = this.protocol.value;
this.config.ip = this.ip.value;
@ -19545,6 +19547,7 @@ class PlexMeetsHomeAssistantEditor extends HTMLElement {
if (!lodash.isEqual(this.config, originalConfig)) {
this.fireEvent(this, 'config-changed', { config: this.config });
}
}
};
this.render = async () => {
const addDropdownItem = (text) => {
@ -19910,6 +19913,7 @@ class PlexMeetsHomeAssistantEditor extends HTMLElement {
}
this.plexValidSection.style.display = 'block';
}
this.loaded = true;
this.content.appendChild(this.plexValidSection);
};
this.setConfig = (config) => {

@ -60,6 +60,8 @@ class PlexMeetsHomeAssistantEditor extends HTMLElement {
plexValidSection = document.createElement('div');
loaded = false;
fireEvent = (
node: HTMLElement,
type: string,
@ -79,6 +81,7 @@ class PlexMeetsHomeAssistantEditor extends HTMLElement {
};
valueUpdated = (): void => {
if (this.loaded) {
const originalConfig = _.clone(this.config);
this.config.protocol = this.protocol.value;
this.config.ip = this.ip.value;
@ -139,6 +142,7 @@ class PlexMeetsHomeAssistantEditor extends HTMLElement {
if (!_.isEqual(this.config, originalConfig)) {
this.fireEvent(this, 'config-changed', { config: this.config });
}
}
};
render = async (): Promise<void> => {
@ -522,6 +526,7 @@ class PlexMeetsHomeAssistantEditor extends HTMLElement {
this.plexValidSection.style.display = 'block';
}
this.loaded = true;
this.content.appendChild(this.plexValidSection);
};

Loading…
Cancel
Save