Repository navigation
Docs: document the pyscript_running event and excluding it from the recorder - #933
Merged
Merged
Conversation
…ecorder Each trigger and service call fires a pyscript_running event whose entity_id lets the logbook show it; there is no entity behind it. Describe the event data and how to exclude the events from the recorder, per function, per file or entirely. Since #899, @service calls fire it too. Closes #929. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #929.
Adds a "Logbook and recorder" section at the end of the trigger decorators in
reference.rst:pyscript_runningevent each time a trigger or a service call runs a function. A call from other pyscript code doesn't fire it, and neither does a trigger that@state_active,@time_activeor@task_unique(kill_me=True)stops.nameis the function's full name with each.replaced by_;entity_idispyscript.followed byname. It's only there for the logbook, and there's no entity or state behind it;func_argskeeps only the fields the logbook uses, since keep only logbook func_args in pyscript_running event #900.excludeexample: for one function (entities), a whole script file (entity_globs) or everything (event_types: [pyscript_running]). Excluded runs also disappear from the logbook history.The
@servicesection now links to it. Since #899,@servicecalls fire the event too, so they'll start appearing in the logbook and recorder after upgrading.I checked the
entitiesandentity_globsexamples with Home Assistant's own filter code. The recorder applies the same filter to an event'sentity_id. The docs build withsphinx-build -W.🤖 Generated with Claude Code