diff --git a/dist/plex-meets-homeassistant.js b/dist/plex-meets-homeassistant.js index 76a1e55..9987a29 100644 --- a/dist/plex-meets-homeassistant.js +++ b/dist/plex-meets-homeassistant.js @@ -20041,7 +20041,12 @@ class PlexMeetsHomeAssistantEditor extends HTMLElement { } this.content.appendChild(this.protocol); this.ip.label = 'Plex IP Address / Hostname'; - this.ip.value = this.config.ip.replace(/^https?\:\/\//i, '').replace(/\/$/, ''); + if (this.config.ip) { + this.ip.value = this.config.ip.replace(/^https?\:\/\//i, '').replace(/\/$/, ''); + } + else { + this.ip.value = this.config.ip; + } this.ip.addEventListener('change', this.valueUpdated); this.content.appendChild(this.ip); this.port.label = 'Plex Port (Optional)'; diff --git a/src/editor.ts b/src/editor.ts index ebaa23c..1c8b81a 100644 --- a/src/editor.ts +++ b/src/editor.ts @@ -268,7 +268,12 @@ class PlexMeetsHomeAssistantEditor extends HTMLElement { this.content.appendChild(this.protocol); this.ip.label = 'Plex IP Address / Hostname'; - this.ip.value = this.config.ip.replace(/^https?\:\/\//i, '').replace(/\/$/, ''); + if (this.config.ip) { + this.ip.value = this.config.ip.replace(/^https?\:\/\//i, '').replace(/\/$/, ''); + } else { + this.ip.value = this.config.ip; + } + this.ip.addEventListener('change', this.valueUpdated); this.content.appendChild(this.ip);