Add a TOC to the condition reference (#19156)

Co-authored-by: Joakim Sørensen <hi@ludeeus.dev>
This commit is contained in:
Chris Browet 2021-09-28 13:42:41 +02:00 committed by GitHub
parent ec82bf75d4
commit 21b47f7bf9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 22 deletions

View File

@ -1,6 +1,8 @@
---
title: "Script Syntax"
description: "Documentation for the Home Assistant Script Syntax."
toc: true
no_toc: true
---
Scripts are a sequence of actions that Home Assistant will execute. Scripts are available as an entity through the standalone [Script component] but can also be embedded in [automations] and [Alexa/Amazon Echo] configurations.
@ -27,24 +29,7 @@ script:
message: "Turned on the ceiling light!"
```
- [Call a Service](#call-a-service)
- [Activate a Scene](#activate-a-scene)
- [Variables](#variables)
- [Test a Condition](#test-a-condition)
- [Delay](#delay)
- [Wait](#wait)
- [Wait Template](#wait-template)
- [Wait for Trigger](#wait-for-trigger)
- [Wait Timeout](#wait-timeout)
- [Wait Variable](#wait-variable)
- [Fire an Event](#fire-an-event)
- [Raise and Consume Custom Events](#raise-and-consume-custom-events)
- [Repeat a Group of Actions](#repeat-a-group-of-actions)
- [Counted Repeat](#counted-repeat)
- [While Loop](#while-loop)
- [Repeat Until](#repeat-until)
- [Repeat Loop Variable](#repeat-loop-variable)
- [Choose a Group of Actions](#choose-a-group-of-actions)
{{ page.content | markdownify | toc_only }}
## Call a Service

View File

@ -1,6 +1,8 @@
---
title: "Conditions"
description: "Documentation about all available conditions."
toc: true
no_toc: true
---
Conditions can be used within a script or automation to prevent further execution. When a condition does not return true, the script or automation stops executing. A condition will look at the system at that moment. For example, a condition can test if a switch is currently turned on or off.
@ -9,7 +11,11 @@ Unlike a trigger, which is always `or`, conditions are `and` by default - all co
All conditions support an optional `alias`.
## AND condition
{{ page.content | markdownify | toc_only }}
## Logical conditions
### AND condition
Test multiple conditions in one condition statement. Passes if all embedded conditions are valid.
@ -42,7 +48,7 @@ condition:
Currently you need to format your conditions like this to be able to edit them using the [automations editor](/docs/automation/editor/).
## OR condition
### OR condition
Test multiple conditions in one condition statement. Passes if any embedded condition is valid.
@ -59,7 +65,7 @@ condition:
below: 20
```
## MIXED AND and OR conditions
### Mixed AND and OR conditions
Test multiple AND and OR conditions in one condition statement. Passes if any embedded condition is valid.
This allows you to mix several AND and OR conditions together.
@ -81,7 +87,7 @@ condition:
below: 20
```
## NOT condition
### NOT condition
Test multiple conditions in one condition statement. Passes if all embedded conditions are **not** valid.