2.0
Juraj Nyíri 3 years ago
parent 3db57baba3
commit e761e0eff9

@ -19726,12 +19726,12 @@ class PlexMeetsHomeAssistantEditor extends HTMLElement {
else if (lodash.isObjectLike(this.config.entity)) { else if (lodash.isObjectLike(this.config.entity)) {
hasUIConfig = false; hasUIConfig = false;
} }
const devicesTitle = document.createElement('h2');
devicesTitle.innerHTML = `Devices Configuration`;
devicesTitle.style.lineHeight = '29px';
devicesTitle.style.marginBottom = '0px';
devicesTitle.style.marginTop = '20px';
if (hasUIConfig) { if (hasUIConfig) {
const devicesTitle = document.createElement('h2');
devicesTitle.innerHTML = `Devices Configuration`;
devicesTitle.style.lineHeight = '29px';
devicesTitle.style.marginBottom = '0px';
devicesTitle.style.marginTop = '20px';
const addDeviceButton = document.createElement('button'); const addDeviceButton = document.createElement('button');
addDeviceButton.style.float = 'right'; addDeviceButton.style.float = 'right';
addDeviceButton.style.fontSize = '20px'; addDeviceButton.style.fontSize = '20px';
@ -19744,7 +19744,10 @@ class PlexMeetsHomeAssistantEditor extends HTMLElement {
} }
}); });
devicesTitle.appendChild(addDeviceButton); devicesTitle.appendChild(addDeviceButton);
this.plexValidSection.appendChild(devicesTitle); }
this.plexValidSection.appendChild(devicesTitle);
// todo: convert entities setup to simple one if not using plexPlayer
if (hasUIConfig) {
if (lodash.isString(this.config.entity)) { if (lodash.isString(this.config.entity)) {
this.config.entity = [this.config.entity]; this.config.entity = [this.config.entity];
} }
@ -19759,6 +19762,12 @@ class PlexMeetsHomeAssistantEditor extends HTMLElement {
}); });
} }
} }
else {
const entitiesUINotAvailable = document.createElement('div');
entitiesUINotAvailable.innerHTML =
'Devices configuration is not available when using plexPlayer client device.<br/>You can edit any other settings through UI and use <b>Show code editor</b> to edit entities.';
this.plexValidSection.appendChild(entitiesUINotAvailable);
}
if (!lodash.isEmpty(this.sections)) { if (!lodash.isEmpty(this.sections)) {
lodash.forEach(this.sections, (section) => { lodash.forEach(this.sections, (section) => {
libraryItems.appendChild(addDropdownItem(section.title)); libraryItems.appendChild(addDropdownItem(section.title));

@ -332,13 +332,12 @@ class PlexMeetsHomeAssistantEditor extends HTMLElement {
hasUIConfig = false; hasUIConfig = false;
} }
const devicesTitle = document.createElement('h2');
devicesTitle.innerHTML = `Devices Configuration`;
devicesTitle.style.lineHeight = '29px';
devicesTitle.style.marginBottom = '0px';
devicesTitle.style.marginTop = '20px';
if (hasUIConfig) { if (hasUIConfig) {
const devicesTitle = document.createElement('h2');
devicesTitle.innerHTML = `Devices Configuration`;
devicesTitle.style.lineHeight = '29px';
devicesTitle.style.marginBottom = '0px';
devicesTitle.style.marginTop = '20px';
const addDeviceButton = document.createElement('button'); const addDeviceButton = document.createElement('button');
addDeviceButton.style.float = 'right'; addDeviceButton.style.float = 'right';
addDeviceButton.style.fontSize = '20px'; addDeviceButton.style.fontSize = '20px';
@ -351,8 +350,11 @@ class PlexMeetsHomeAssistantEditor extends HTMLElement {
} }
}); });
devicesTitle.appendChild(addDeviceButton); devicesTitle.appendChild(addDeviceButton);
}
this.plexValidSection.appendChild(devicesTitle); this.plexValidSection.appendChild(devicesTitle);
// todo: convert entities setup to simple one if not using plexPlayer
if (hasUIConfig) {
if (_.isString(this.config.entity)) { if (_.isString(this.config.entity)) {
this.config.entity = [this.config.entity]; this.config.entity = [this.config.entity];
} }
@ -366,6 +368,11 @@ class PlexMeetsHomeAssistantEditor extends HTMLElement {
} }
}); });
} }
} else {
const entitiesUINotAvailable = document.createElement('div');
entitiesUINotAvailable.innerHTML =
'Devices configuration is not available when using plexPlayer client device.<br/>You can edit any other settings through UI and use <b>Show code editor</b> to edit entities.';
this.plexValidSection.appendChild(entitiesUINotAvailable);
} }
if (!_.isEmpty(this.sections)) { if (!_.isEmpty(this.sections)) {

Loading…
Cancel
Save