diff --git a/custom_components/zidoo/frontend/zidoo-search-card.js b/custom_components/zidoo/frontend/zidoo-search-card.js index a1ea412..b19cb3c 100644 --- a/custom_components/zidoo/frontend/zidoo-search-card.js +++ b/custom_components/zidoo/frontend/zidoo-search-card.js @@ -29,16 +29,15 @@ customElements.whenDefined('card-tools').then(() => { return ct.LitHtml `
- - - - +
+ + + + + + + +
Search Media
${(this.buttons.includes("video")) ? ct.LitHtml ` @@ -106,92 +105,16 @@ customElements.whenDefined('card-tools').then(() => { margin-left: auto; margin-right: auto; } - #searchIcon { + #searchIcon { padding: 10px; } - `; - } - - /* - static getConfigElement() { - return document.createElement("zidoo-search-editor"); - } - */ - } - - /* - class ZidoSearchEditor extends ct.LitElement { - setConfig(config) { - this._config = config; - this._included_domains = ["media_player"] - - this.results = []; - this._getEntities(); - } - - _getEntities() { - this.results = []; - - try { - for (var entity_id in this.hass.states) { - if ( this._included_domains.includes(entity_id.split(".")[0])) { - this.results.push(entity_id); - } - } - } catch (err) { - console.warn(err); - } - } - - configChanged(newConfig) { - const event = new Event("config-changed", { - bubbles: true, - composed: true, - }); - event.detail = { config: newConfig }; - this.dispatchEvent(event); - } - - render() { - var rows = this.results.map((entity_id) => this._createResultRow(entity_id)); - return ct.LitHtml ` - -
- - ${(rows.length > 0) ? - ct.LitHtml `
${rows}
` - : ''} -
-
- `; - } - - _createResultRow(entity_id) { - var row = ct.createEntityRow({entity: entity_id}); - row.addEventListener("click", () => ct.moreInfo(entity_id)); - row.hass = this.hass; - return row; - } - - static get styles() { - return ct.LitCSS ` - #searchContainer { - width: 90%; - display: block; - margin-left: auto; - margin-right: auto; - } - #searchIcon { - padding: 10px; + #searchText { + width: 100%; } `; } - } - customElements.define("zidoo-search-editor", ZidoSearchEditor); - */ customElements.define('zidoo-search-card', ZidooSearchCard); }); diff --git a/custom_components/zidoo/manifest.json b/custom_components/zidoo/manifest.json index 6a7aa53..05caf2c 100644 --- a/custom_components/zidoo/manifest.json +++ b/custom_components/zidoo/manifest.json @@ -7,5 +7,5 @@ "requirements": [], "codeowners": ["@wizmo2"], "iot_class": "local_polling", - "version": "1.4.1" + "version": "1.4.2" }