From 75505dbfb8b5fdc630e91290cc3122ee3e719131 Mon Sep 17 00:00:00 2001 From: Gil Peeters Date: Sat, 28 Sep 2019 22:02:37 +1000 Subject: [PATCH] Added 'availability_template' to Template Vacuum platform (#10309) * Added 'availability_template' to Template Vacuum platform * Fixed Syntax and default * Removed optional parameter from example config * Apply suggestions from code review Co-Authored-By: Franck Nijhof --- source/_components/vacuum.template.markdown | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/source/_components/vacuum.template.markdown b/source/_components/vacuum.template.markdown index 0b705d7f27c..bb5c7bad34a 100644 --- a/source/_components/vacuum.template.markdown +++ b/source/_components/vacuum.template.markdown @@ -15,6 +15,8 @@ return_to_base, clean_spot, locate and set_fan_speed commands of a vacuum. To enable Template Vacuums in your installation, add the following to your `configuration.yaml` file: +{% raw %} + ```yaml # Example configuration.yaml entry vacuum: @@ -22,9 +24,11 @@ vacuum: vacuums: living_room_vacuum: start: - service: script.vacuum_start + service: script.vacuum_start ``` +{% endraw %} + {% configuration %} vacuums: description: List of your vacuums. @@ -47,6 +51,11 @@ vacuum: description: Defines a template to get the fan speed of the vacuum. 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 start: description: Defines an action to run when the vacuum is started. required: true @@ -117,6 +126,7 @@ vacuum: This example shows how to use templates to specify the state of the vacuum. {% raw %} + ```yaml vacuum: - platform: template @@ -144,4 +154,5 @@ vacuum: - Medium - High ``` + {% endraw %}