From 2e987e4e61f0d10b806de6d2c11557a3b4798302 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Tue, 4 Jul 2023 15:23:28 -0500 Subject: [PATCH] Use slots in TraceElement If the user has a lot of automations there can be a lot of these floating around in memory. This makes them a bit smaller --- homeassistant/helpers/trace.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/homeassistant/helpers/trace.py b/homeassistant/helpers/trace.py index c1d22157a317af..fd7a3081f7a345 100644 --- a/homeassistant/helpers/trace.py +++ b/homeassistant/helpers/trace.py @@ -17,6 +17,17 @@ class TraceElement: """Container for trace data.""" + __slots__ = ( + "_child_key", + "_child_run_id", + "_error", + "path", + "_result", + "reuse_by_child", + "_timestamp", + "_variables", + ) + def __init__(self, variables: TemplateVarsType, path: str) -> None: """Container for trace data.""" self._child_key: str | None = None