Skip to content

Commit ea8cbb3

Browse files
committed
minor fixes and edits to new text in @state_trigger
1 parent 3ffe6e4 commit ea8cbb3

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

docs/reference.rst

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -215,14 +215,11 @@ occurs if it evaluates to ``True`` (or non-zero). For each state variable, eg: `
215215
the prior value is also available to the expression as ``domain.name.old`` in case you want to
216216
condition the trigger on the prior value too.
217217

218-
Optional arguments are:
218+
Multiple ``str_expr`` arguments are logically "or"ed together, so the trigger occurs if any of the
219+
expressions evaluate to ``True``. Any argument can alternatively be a list or set of strings, and
220+
they are treated the same as multiple arguments by "or"ing them together.
219221

220-
``state_hold=None``
221-
A numeric duration in seconds that delays executing the trigger function for this amount of time.
222-
If the state trigger expression changes back to ``False`` during that time, the trigger is
223-
canceled and a wait for a new trigger begins. If the state trigger expression changes, but is
224-
still ``True`` then the ``state_hold`` time is not restarted - the trigger will still occur
225-
that number of seconds after the first state trigger.
222+
Optional arguments are:
226223

227224
``state_check_now=False``
228225
If set, the ``@state_trigger`` expression is evaluated immediately when the trigger function
@@ -231,9 +228,12 @@ Optional arguments are:
231228
changes, and not when the trigger function is first defined. This option is the same as
232229
in the ``task.wait_until`` function, except the default value is ``True`` in that case.
233230

234-
Multiple arguments are logically "or"ed together, so the trigger occurs if any of the expressions
235-
evaluate to ``True``. Any argument can alternatively be a list or set of strings, and they are
236-
treated the same as multiple arguments by "or"ing them together.
231+
``state_hold=None``
232+
A numeric duration in seconds that delays executing the trigger function for this amount of time.
233+
If the state trigger expression changes back to ``False`` during that time, the trigger is
234+
canceled and a wait for a new trigger begins. If the state trigger expression changes, but is
235+
still ``True`` then the ``state_hold`` time is not restarted - the trigger will still occur
236+
that number of seconds after the first state trigger.
237237

238238
All state variables in HASS have string values. So you’ll have to do comparisons against string
239239
values or cast the variable to an integer or float. These two examples are essentially equivalent
@@ -262,7 +262,7 @@ You can specify a state trigger on any change with a string that is just the sta
262262
@state_trigger("domain.light_level")
263263
264264
If you use this form, there's no point in also specifying ``state_hold`` since the expression
265-
is always True whenever the state variable changes - there is no way for it to evaluate
265+
is always ``True`` whenever the state variable changes - there is no way for it to evaluate
266266
to ``False`` and to re-start the trigger process. If you do specify ``state_hold`` in this
267267
case it will simply delay the trigger by the specified time.
268268

@@ -311,7 +311,7 @@ form to use if you have multiple decorators, since each one passes different var
311311
function (although all of them set ``trigger_type``).
312312

313313
If ``state_check_now`` is set to ``True`` and the trigger occurs during its immediate check, since
314-
there is no underlying state variable change, the trigger function is called with only this arguments:
314+
there is no underlying state variable change, the trigger function is called with only this argument:
315315

316316
.. code:: python
317317

0 commit comments

Comments
 (0)