* Store automation and script traces
* Pylint
* Deduplicate code
* Fix issues when no stored traces are available
* Store serialized data for restored traces
* Update WS API
* Update test
* Restore context
* Improve tests
* Add new test files
* Rename restore_traces to async_restore_traces
* Refactor trace.websocket_api
* Defer loading stored traces
* Lint
* Revert refactoring which is no longer needed
* Correct order when restoring traces
* Apply suggestion from code review
* Improve test coverage
* Apply suggestions from code review
* Include changed variables in automation trace
* Deduplicate some code
* Tweak
* Apply suggestions from code review
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
* Fix format
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
* Merge action and condition traces
* Update __init__.py
* Add typing to AutomationTrace
* Make trace_get prepare a new trace by default
* Correct typing of trace_cv
* Fix tests
* Initial prototype of automation tracing
* Small fixes
* Lint
* Move trace helpers to its own file
* Improve trace for state and numeric_state conditions
* Tweaks + apply suggestions from code review
* Index traces by automation_id, trace while script is running
* Refactor condition tracing
* Improve WS API to get traces for single automation
* Add tests
* Fix imports
* Fix imports
* Address review comments
* Cap logging of loops
* Remove unused ContextVar action_config