From a034d4b4386eecda1535bfd83ea1aeb5a25ae90d Mon Sep 17 00:00:00 2001 From: Florian Klien Date: Sun, 19 Nov 2017 21:20:30 +0100 Subject: [PATCH] truth table for condition sun (#3961) * added truth table to illustrate sunset condition truth table illustrates sunset condition with and without offsets * :pencil2: Small typo fix. --- source/_docs/scripts/conditions.markdown | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/source/_docs/scripts/conditions.markdown b/source/_docs/scripts/conditions.markdown index 5763106da34..3314e0f4273 100644 --- a/source/_docs/scripts/conditions.markdown +++ b/source/_docs/scripts/conditions.markdown @@ -114,6 +114,23 @@ condition: 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 %} 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`. -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 %}