@@ -215,14 +215,11 @@ occurs if it evaluates to ``True`` (or non-zero). For each state variable, eg: `
215
215
the prior value is also available to the expression as ``domain.name.old `` in case you want to
216
216
condition the trigger on the prior value too.
217
217
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.
219
221
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:
226
223
227
224
``state_check_now=False ``
228
225
If set, the ``@state_trigger `` expression is evaluated immediately when the trigger function
@@ -231,9 +228,12 @@ Optional arguments are:
231
228
changes, and not when the trigger function is first defined. This option is the same as
232
229
in the ``task.wait_until `` function, except the default value is ``True `` in that case.
233
230
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.
237
237
238
238
All state variables in HASS have string values. So you’ll have to do comparisons against string
239
239
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
262
262
@state_trigger (" domain.light_level" )
263
263
264
264
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
266
266
to ``False `` and to re-start the trigger process. If you do specify ``state_hold `` in this
267
267
case it will simply delay the trigger by the specified time.
268
268
@@ -311,7 +311,7 @@ form to use if you have multiple decorators, since each one passes different var
311
311
function (although all of them set ``trigger_type ``).
312
312
313
313
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 :
315
315
316
316
.. code :: python
317
317
0 commit comments