truth table for condition sun (#3961)

* added truth table to illustrate sunset condition

truth table illustrates sunset condition with and without offsets

* ✏️ Small typo fix.
This commit is contained in:
Florian Klien 2017-11-19 21:20:30 +01:00 committed by Franck Nijhof
parent 797fd4a69f
commit a034d4b438

View File

@ -114,6 +114,23 @@ condition:
after_offset: "-1:00:00" after_offset: "-1:00:00"
``` ```
Here is a truth table to clarify the parameters with and without offset:
| command | night | at sunrise | daytime | at sunset |
| ---------------------------------- | ------------ |:-----------:| ------- |:----------:|
| `after: sunset` | True | ⇒ | False | ⇒ |
| + `after_offset: "01:00:00"` | True | ⇒ | False | **+1h** |
| + `after_offset: "-01:00:00"` | True | ⇒ | False | **-1h** |
| `before: sunset` | False | ⇒ | True | ⇒ |
| + `before_offset: "01:00:00"` | False | ⇒ | True | **+1h** |
| + `before_offset: "-01:00:00"` | False | ⇒ | True | **-1h** |
| `after: sunrise` | False | ⇒ | True | ⇒ |
| + `after_offset: "01:00:00"` | False | **+1h** | True | ⇒ |
| + `after_offset: "-01:00:00"` | False | **-1h** | True | ⇒ |
| `before: sunrise` | True | ⇒ | False | ⇒ |
| + `before_offset: "01:00:00"` | True | **+1h** | False | ⇒ |
| + `before_offset: "-01:00:00"` | True | **-1h** | False | ⇒ |
### {% linkable_title Template condition %} ### {% linkable_title Template condition %}
The template condition will test if the [given template][template] renders a value equal to true. This is achieved by having the template result in a true boolean expression or by having the template render 'true'. The template condition will test if the [given template][template] renders a value equal to true. This is achieved by having the template result in a true boolean expression or by having the template render 'true'.
@ -146,7 +163,7 @@ condition:
``` ```
Valid values for `weekday` are `mon`, `tue`, `wed`, `thu`, `fri`, `sat`, `sun`. Valid values for `weekday` are `mon`, `tue`, `wed`, `thu`, `fri`, `sat`, `sun`.
Time condition windows can span across the midnight threshold. In the example above, the condition window is from 3pm to 2am. Time condition windows can span across the midnight threshold. In the example above, the condition window is from 3pm to 2am.
### {% linkable_title Zone condition %} ### {% linkable_title Zone condition %}