2.0
Juraj Nyíri 3 years ago
parent 109020b90a
commit dba631e3de

@ -19461,6 +19461,7 @@ class PlexMeetsHomeAssistantEditor extends HTMLElement {
this.showSearch = document.createElement('paper-dropdown-menu'); this.showSearch = document.createElement('paper-dropdown-menu');
this.devicesTabs = 0; this.devicesTabs = 0;
this.entities = []; this.entities = [];
this.scriptEntities = [];
this.sections = []; this.sections = [];
this.entitiesRegistry = false; this.entitiesRegistry = false;
this.plexValidSection = document.createElement('div'); this.plexValidSection = document.createElement('div');
@ -19565,6 +19566,12 @@ class PlexMeetsHomeAssistantEditor extends HTMLElement {
if (this.content) if (this.content)
this.content.remove(); this.content.remove();
if (this.hassObj && !this.entitiesRegistry) { 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.entitiesRegistry = await fetchEntityRegistry(this.hassObj.connection);
} }
this.entities = []; this.entities = [];

@ -46,6 +46,8 @@ class PlexMeetsHomeAssistantEditor extends HTMLElement {
entities: Array<any> = []; entities: Array<any> = [];
scriptEntities: Array<string> = [];
sections: Array<Record<string, any>> = []; sections: Array<Record<string, any>> = [];
entitiesRegistry: false | Array<Record<string, any>> = false; entitiesRegistry: false | Array<Record<string, any>> = false;
@ -159,6 +161,12 @@ class PlexMeetsHomeAssistantEditor extends HTMLElement {
}; };
if (this.content) this.content.remove(); if (this.content) this.content.remove();
if (this.hassObj && !this.entitiesRegistry) { 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); this.entitiesRegistry = await fetchEntityRegistry(this.hassObj.connection);
} }

Loading…
Cancel
Save