Address review comments from trace refactoring PRs (#48288)

This commit is contained in:
Erik Montnemery 2021-03-29 08:09:14 +02:00 committed by GitHub
parent ee81869c05
commit 14ef0531f0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 130 additions and 140 deletions

View file

@ -2,8 +2,24 @@
from __future__ import annotations
from contextlib import contextmanager
from typing import Any
from homeassistant.components.trace import ScriptTrace, async_store_trace
from homeassistant.components.trace import ActionTrace, async_store_trace
from homeassistant.core import Context
class ScriptTrace(ActionTrace):
"""Container for automation trace."""
def __init__(
self,
item_id: str,
config: dict[str, Any],
context: Context,
):
"""Container for automation trace."""
key = ("script", item_id)
super().__init__(key, config, context)
@contextmanager