mirror of
https://github.com/home-assistant/core.git
synced 2025-07-28 07:37:34 +00:00
Improve docstrings of event helpers related to state changes (#148722)
This commit is contained in:
parent
50047f0a4e
commit
dcbdce4b2b
@ -316,6 +316,10 @@ def async_track_state_change_event(
|
|||||||
Unlike async_track_state_change, async_track_state_change_event
|
Unlike async_track_state_change, async_track_state_change_event
|
||||||
passes the full event to the callback.
|
passes the full event to the callback.
|
||||||
|
|
||||||
|
The action will not be called immediately, but will be scheduled to run
|
||||||
|
in the next event loop iteration, even if the action is decorated with
|
||||||
|
@callback.
|
||||||
|
|
||||||
In order to avoid having to iterate a long list
|
In order to avoid having to iterate a long list
|
||||||
of EVENT_STATE_CHANGED and fire and create a job
|
of EVENT_STATE_CHANGED and fire and create a job
|
||||||
for each one, we keep a dict of entity ids that
|
for each one, we keep a dict of entity ids that
|
||||||
@ -866,6 +870,10 @@ def async_track_state_change_filtered(
|
|||||||
) -> _TrackStateChangeFiltered:
|
) -> _TrackStateChangeFiltered:
|
||||||
"""Track state changes with a TrackStates filter that can be updated.
|
"""Track state changes with a TrackStates filter that can be updated.
|
||||||
|
|
||||||
|
The action will not be called immediately, but will be scheduled to run
|
||||||
|
in the next event loop iteration, even if the action is decorated with
|
||||||
|
@callback.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
hass:
|
hass:
|
||||||
Home assistant object.
|
Home assistant object.
|
||||||
@ -1348,9 +1356,13 @@ def async_track_template_result(
|
|||||||
then whenever the output from the template changes. The template will
|
then whenever the output from the template changes. The template will
|
||||||
be reevaluated if any states referenced in the last run of the
|
be reevaluated if any states referenced in the last run of the
|
||||||
template change, or if manually triggered. If the result of the
|
template change, or if manually triggered. If the result of the
|
||||||
evaluation is different from the previous run, the listener is passed
|
evaluation is different from the previous run, the action is passed
|
||||||
the result.
|
the result.
|
||||||
|
|
||||||
|
The action will not be called immediately, but will be scheduled to run
|
||||||
|
in the next event loop iteration, even if the action is decorated with
|
||||||
|
@callback.
|
||||||
|
|
||||||
If the template results in an TemplateError, this will be returned to
|
If the template results in an TemplateError, this will be returned to
|
||||||
the listener the first time this happens but not for subsequent errors.
|
the listener the first time this happens but not for subsequent errors.
|
||||||
Once the template returns to a non-error condition the result is sent
|
Once the template returns to a non-error condition the result is sent
|
||||||
|
Loading…
x
Reference in New Issue
Block a user