Update sun condition

At some point the sun condition docs had their order reworked so the problem with the "after dark" condition is now confusing. I've restructured it and make it clearer that the example isn't valid.
This commit is contained in:
Dubh Ad 2022-08-18 13:36:38 +01:00 committed by GitHub
parent 8c573a344f
commit f8ade713bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -396,15 +396,6 @@ condition:
after_offset: "-01:00:00" after_offset: "-01:00:00"
``` ```
This is 'when dark' - equivalent to a state condition on `sun.sun` of `below_horizon`:
```yaml
condition:
- condition: sun
after: sunset
before: sunrise
```
This is 'when light' - equivalent to a state condition on `sun.sun` of `above_horizon`: This is 'when light' - equivalent to a state condition on `sun.sun` of `above_horizon`:
```yaml ```yaml
@ -414,7 +405,16 @@ condition:
before: sunset before: sunset
``` ```
We cannot use both keys in this case as it will always be `false`. This is (invalid) 'when dark' - equivalent to a state condition on `sun.sun` of `below_horizon`:
```yaml
condition:
- condition: sun
after: sunset
before: sunrise
```
However, we cannot use both keys in this case as it will always be `false`, so instead you have to use:
```yaml ```yaml
condition: condition: