Skip to content

Commit acb0557

Browse files
grillpfrenck
authored andcommitted
Added 'availability_template' to all Template Fan platform (home-assistant#10312)
* Added 'availability_template' to all Template Fan platform * Fixed Syntax and default * Removed optional parameter from example config * Apply suggestions from code review Co-Authored-By: Franck Nijhof <frenck@frenck.nl>
1 parent c752427 commit acb0557

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

source/_components/fan.template.markdown

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ To enable Template Fans in your installation, add the following to your
1717
`configuration.yaml` file:
1818

1919
{% raw %}
20+
2021
```yaml
2122
# Example configuration.yaml entry
2223
fan:
@@ -49,6 +50,7 @@ fan:
4950
- '2'
5051
- '3'
5152
```
53+
5254
{% endraw %}
5355
5456
{% configuration %}
@@ -77,6 +79,11 @@ fan:
7779
description: "Defines a template to get the direction of the fan. Valid value: 'forward'/'reverse'"
7880
required: false
7981
type: template
82+
availability_template:
83+
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`.
84+
required: false
85+
type: template
86+
default: true
8087
turn_on:
8188
description: Defines an action to run when the fan is turned on.
8289
required: true

0 commit comments

Comments
 (0)