Added 'availability_template' to Template Cover platform (#10314)

* Added 'availability_template' to all Template Cover platform

* Fixed Syntax and default

* Apply suggestions from code review

Co-Authored-By: Franck Nijhof <frenck@frenck.nl>

* Removed optional values from example configuration
This commit is contained in:
Gil Peeters 2019-09-28 21:53:01 +10:00 committed by Charles Garwood
parent 114e496055
commit 822a45b6d4

View File

@ -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:
@ -34,6 +35,7 @@ cover:
stop_cover:
service: script.stop_garage_door
```
{% endraw %}
{% configuration %}
@ -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
@ -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
@ -162,6 +170,7 @@ cover:
mdi:garage
{% endif %}
```
{% endraw %}
### Multiple Covers
@ -169,6 +178,7 @@ cover:
This example allows you to control two or more covers at once.
{% raw %}
```yaml
homeassistant:
customize:
@ -249,6 +259,7 @@ automation:
entity_id: cover.cover_group
position: 25
```
{% endraw %}
### Change The Icon
@ -256,6 +267,7 @@ automation:
This example shows how to change the icon based on the cover state.
{% raw %}
```yaml
cover:
- platform: template
@ -282,6 +294,7 @@ cover:
mdi:window-closed
{% endif %}
```
{% endraw %}
### Change The Entity Picture
@ -289,6 +302,7 @@ cover:
This example shows how to change the entity picture based on the cover state.
{% raw %}
```yaml
cover:
- platform: template
@ -315,4 +329,5 @@ cover:
/local/cover-closed.png
{% endif %}
```
{% endraw %}