From dba631e3de927eb906825fb5b81fa2f4d859decc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juraj=20Nyi=CC=81ri?= Date: Mon, 12 Jul 2021 15:24:38 +0200 Subject: [PATCH] no message --- dist/plex-meets-homeassistant.js | 7 +++++++ src/editor.ts | 8 ++++++++ 2 files changed, 15 insertions(+) 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); }