From b895b8f95416ca7c674dbcf4e1745949097dbdb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Lov=C3=A9n?= Date: Fri, 14 Dec 2018 09:14:08 +0100 Subject: [PATCH] Update to use card-tools. Fixes #6. Fixes #16. Fixes #18. Check #19 --- README.md | 2 + fold-entity-row.js | 255 ++++++++++++++++++--------------------------- 2 files changed, 102 insertions(+), 155 deletions(-) diff --git a/README.md b/README.md index 66ae1a7..3960c08 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,8 @@ fold-entity-row Make a group from entities in a lovelace entities card - and fold them away when you don't want to see them. +This card requires [card-tools](https://github.com/thomasloven/lovelace-card-tools) to be installed. + ## Options | Name | Type | Default | Description diff --git a/fold-entity-row.js b/fold-entity-row.js index b710b95..da1a55f 100644 --- a/fold-entity-row.js +++ b/fold-entity-row.js @@ -1,181 +1,126 @@ -class FoldRow extends Polymer.Element { +var LitElement = LitElement || Object.getPrototypeOf(customElements.get('hui-error-entity-row')); +class FoldEntityRow extends LitElement { - static get template() { - return Polymer.html` - -
+ static get properties() { + return { + _closed: Boolean, + }; + } + + render() { + return window.cardTools.litHtml` + ${this._renderStyle()}