Add ability to expand groups dynamically. Fix thomasloven/lovelace-auto-entities#18

This commit is contained in:
Thomas Lovén 2019-08-05 16:28:19 +02:00
parent 44c666e421
commit e3f585601f
3 changed files with 20 additions and 1 deletions

View File

@ -130,5 +130,22 @@ card:
![advanced](https://user-images.githubusercontent.com/1299821/59793890-ed65b380-92d7-11e9-9ed6-8dc1c15d749b.png) ![advanced](https://user-images.githubusercontent.com/1299821/59793890-ed65b380-92d7-11e9-9ed6-8dc1c15d749b.png)
- If `entity` (not `entities`) is set and is a group, it will be expanded
```yaml
type: custom:auto-entities
card:
type: entities
title: All groups
filter:
include:
- domain: group
options:
type: custom:fold-entity-row
```
![image](https://user-images.githubusercontent.com/1299821/62471886-e4ed0d80-b79d-11e9-97b4-7edb721338cc.png)
--- ---
<a href="https://www.buymeacoffee.com/uqD6KHCdJ" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/white_img.png" alt="Buy Me A Coffee" style="height: auto !important;width: auto !important;" ></a> <a href="https://www.buymeacoffee.com/uqD6KHCdJ" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/white_img.png" alt="Buy Me A Coffee" style="height: auto !important;width: auto !important;" ></a>

File diff suppressed because one or more lines are too long

View File

@ -24,6 +24,8 @@ class FoldEntityRow extends LitElement {
this.open = this.open || this._config.open; this.open = this.open || this._config.open;
this.head = this._config.head; this.head = this._config.head;
if (this._config.entity)
this.head = this._config.entity;
if (typeof this.head === "string") if (typeof this.head === "string")
this.head = {entity: this.head}; this.head = {entity: this.head};