diff --git a/dist/plex-meets-homeassistant.js b/dist/plex-meets-homeassistant.js index bfc0bbd..07ecb42 100644 --- a/dist/plex-meets-homeassistant.js +++ b/dist/plex-meets-homeassistant.js @@ -19726,12 +19726,12 @@ class PlexMeetsHomeAssistantEditor extends HTMLElement { else if (lodash.isObjectLike(this.config.entity)) { 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) { - 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'); addDeviceButton.style.float = 'right'; addDeviceButton.style.fontSize = '20px'; @@ -19744,7 +19744,10 @@ class PlexMeetsHomeAssistantEditor extends HTMLElement { } }); 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)) { 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.
You can edit any other settings through UI and use Show code editor to edit entities.'; + this.plexValidSection.appendChild(entitiesUINotAvailable); + } if (!lodash.isEmpty(this.sections)) { lodash.forEach(this.sections, (section) => { libraryItems.appendChild(addDropdownItem(section.title)); diff --git a/src/editor.ts b/src/editor.ts index b646183..d54c17d 100644 --- a/src/editor.ts +++ b/src/editor.ts @@ -332,13 +332,12 @@ class PlexMeetsHomeAssistantEditor extends HTMLElement { 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) { - 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'); addDeviceButton.style.float = 'right'; addDeviceButton.style.fontSize = '20px'; @@ -351,8 +350,11 @@ class PlexMeetsHomeAssistantEditor extends HTMLElement { } }); 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)) { 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.
You can edit any other settings through UI and use Show code editor to edit entities.'; + this.plexValidSection.appendChild(entitiesUINotAvailable); } if (!_.isEmpty(this.sections)) {