Skip to content

Commit

Permalink
Added 'availability_template' to Template Cover platform (home-assist…
Browse files Browse the repository at this point in the history
…ant#10314)

* Added 'availability_template' to all Template Cover platform

* Fixed Syntax and default

* Apply suggestions from code review

Co-Authored-By: Franck Nijhof <[email protected]>

* Removed optional values from example configuration
  • Loading branch information
grillp authored and cgarwood committed Sep 28, 2019
1 parent 114e496 commit 822a45b
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions source/_components/cover.template.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ To enable Template Covers in your installation,
add the following to your `configuration.yaml` file:

{% raw %}

```yaml
# Example configuration.yaml entry
cover:
Expand All @@ -34,6 +35,7 @@ cover:
stop_cover:
service: script.stop_garage_door
```
{% endraw %}
{% configuration %}
Expand Down Expand Up @@ -62,6 +64,11 @@ cover:
description: Defines a template to specify which icon to use.
required: false
type: template
availability_template:
description: Defines a template to get the `available` state of the component. If the template returns `true`, the device is `available`. If the template returns any other value, the device will be `unavailable`. If `availability_template` is not configured, the component will always be `available`.
required: false
type: template
default: true
device_class:
description: Sets the [class of the device](/components/cover/), changing the device state and icon that is displayed on the frontend.
required: false
Expand Down Expand Up @@ -136,6 +143,7 @@ This example converts a garage door with a controllable switch and position
sensor into a cover.

{% raw %}

```yaml
cover:
- platform: template
Expand All @@ -162,13 +170,15 @@ cover:
mdi:garage
{% endif %}
```

{% endraw %}

### Multiple Covers

This example allows you to control two or more covers at once.

{% raw %}

```yaml
homeassistant:
customize:
Expand Down Expand Up @@ -249,13 +259,15 @@ automation:
entity_id: cover.cover_group
position: 25
```

{% endraw %}

### Change The Icon

This example shows how to change the icon based on the cover state.

{% raw %}

```yaml
cover:
- platform: template
Expand All @@ -282,13 +294,15 @@ cover:
mdi:window-closed
{% endif %}
```

{% endraw %}

### Change The Entity Picture

This example shows how to change the entity picture based on the cover state.

{% raw %}

```yaml
cover:
- platform: template
Expand All @@ -315,4 +329,5 @@ cover:
/local/cover-closed.png
{% endif %}
```

{% endraw %}

0 comments on commit 822a45b

Please sign in to comment.