From f8ade713bd284a049f4d29489c3993119bf756ce Mon Sep 17 00:00:00 2001 From: Dubh Ad Date: Thu, 18 Aug 2022 13:36:38 +0100 Subject: [PATCH] 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. --- source/_docs/scripts/conditions.markdown | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/source/_docs/scripts/conditions.markdown b/source/_docs/scripts/conditions.markdown index f810a2fb70e..38ca9992f7e 100644 --- a/source/_docs/scripts/conditions.markdown +++ b/source/_docs/scripts/conditions.markdown @@ -396,15 +396,6 @@ condition: 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`: ```yaml @@ -414,7 +405,16 @@ condition: 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 condition: