diff --git a/dist/plex-meets-homeassistant.js b/dist/plex-meets-homeassistant.js index 8a4f619..a1e46b6 100644 --- a/dist/plex-meets-homeassistant.js +++ b/dist/plex-meets-homeassistant.js @@ -19461,6 +19461,7 @@ class PlexMeetsHomeAssistantEditor extends HTMLElement { this.showSearch = document.createElement('paper-dropdown-menu'); this.devicesTabs = 0; this.entities = []; + this.scriptEntities = []; this.sections = []; this.entitiesRegistry = false; this.plexValidSection = document.createElement('div'); @@ -19565,6 +19566,12 @@ class PlexMeetsHomeAssistantEditor extends HTMLElement { if (this.content) this.content.remove(); if (this.hassObj && !this.entitiesRegistry) { + lodash.forOwn(this.hassObj.states, (value, key) => { + if (lodash.startsWith(key, 'script.')) { + this.scriptEntities.push(key); + } + }); + console.log(this.scriptEntities); this.entitiesRegistry = await fetchEntityRegistry(this.hassObj.connection); } this.entities = []; diff --git a/src/editor.ts b/src/editor.ts index a617ff4..6efef83 100644 --- a/src/editor.ts +++ b/src/editor.ts @@ -46,6 +46,8 @@ class PlexMeetsHomeAssistantEditor extends HTMLElement { entities: Array = []; + scriptEntities: Array = []; + sections: Array> = []; entitiesRegistry: false | Array> = false; @@ -159,6 +161,12 @@ class PlexMeetsHomeAssistantEditor extends HTMLElement { }; if (this.content) this.content.remove(); if (this.hassObj && !this.entitiesRegistry) { + _.forOwn(this.hassObj.states, (value, key) => { + if (_.startsWith(key, 'script.')) { + this.scriptEntities.push(key); + } + }); + console.log(this.scriptEntities); this.entitiesRegistry = await fetchEntityRegistry(this.hassObj.connection); }