Updating documentation

This commit is contained in:
Thomas Lovén 2018-11-01 14:48:14 +01:00
parent 9ed13c6f07
commit 96f29045e0

View File

@ -3,69 +3,57 @@ 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. Make a group from entities in a lovelace entities card - and fold them away when you don't want to see them.
## Options
| Name | Type | Default | Description
| ---- | ---- | ------- | -----------
| type | string | **Required** | `custom:fold-entity-row`
| head | string/object | **Required** | The entity or row that should be the header
| items | list | none | Entites or rows to put in the fold
| group_config | object | none | Extra options to put on each item in the list
| open | boolean | false | Set to true to have the fold opened by default
--- ---
```yaml ```yaml
resources: type: entities
- url: /local/fold-entity-row.js title: Folding entities
type: js
views:
- title: My view
cards:
- type: entities
entities: entities:
- light.bed_light
- type: custom:fold-entity-row - type: custom:fold-entity-row
head: input_select.tod head: sensor.yr_symbol
items: items:
- switch.tod_dark - sensor.outside_humidity
- entity: input_datetime.tod_morning - sensor.outside_temperature
type: custom:time-input-row - light.bed_light
...
```
![closed open](https://user-images.githubusercontent.com/1299821/47018117-5b0f7d80-d154-11e8-91b1-3405cd5c0662.jpg)
### Options
- `head` (required) - The entity that will be on the top of the list. Can be any type of entity that works in a entities card, with any options. If the entity is a group, the items of the fold will be automatically populated by the entities in the group.
- `items` - Entities in the fold. Can be any kind of entity that works in an entities card, with any options.
- `group_config` - configuration options that will be applied to every entity in the fold.
- `open` - set to `true` to have the fold opened by default.
---
```yaml
- type: entities
entities:
- type: custom:fold-entity-row
head: group.flux_switches
- type: custom:fold-entity-row - type: custom:fold-entity-row
head: head:
entity: light.taklampa_vardagsrum type: section
type: custom:toggle-lock-entity-row label: Lights
group_config: group_config:
icon: mdi:fan secondary_info: last-changed
items: items:
- light.takflakt1 - light.bed_light
- light.takflakt2 - light.ceiling_lights
- entity: light.takflakt3 - light.kitchen_lights
type: custom:slider-entity-row - light.bed_light
- light.takflakt4
- type: custom:fold-entity-row
head:
type: divider
style:
height: 30px
margin: 4px 0
background: center / contain url("/local/images/divider.png")
background-repeat: no-repeat
items:
- light.takflakt1
- light.takflakt2
- light.takflakt3
- light.takflakt4
``` ```
![special options](https://user-images.githubusercontent.com/1299821/47018785-cf96ec00-d155-11e8-8156-d54524d387ad.jpg) ![fold-entity-row](https://user-images.githubusercontent.com/1299821/47855185-281be980-dde4-11e8-92a6-643e8a47d8e9.png)
### Groups will populate the fold automatically
```yaml
type: entities
title: Folding groups
entities:
- type: custom:fold-entity-row
head: group.all_lights
- type: custom:fold-entity-row
head: group.all_scripts
- type: custom:fold-entity-row
head: group.all_automations
```
![folding groups](https://user-images.githubusercontent.com/1299821/47855259-5d283c00-dde4-11e8-8405-94c269e53935.png)