Copy instead of deepcopy the variables in a wait for trigger (#39796)

This commit is contained in:
Paulus Schoutsen 2020-09-08 15:23:38 +02:00 committed by GitHub
parent 5bcffba53e
commit 63aa46369b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,5 @@
"""Helpers to execute scripts."""
import asyncio
from copy import deepcopy
from datetime import datetime, timedelta
from functools import partial
import itertools
@ -572,7 +571,7 @@ class _ScriptRun:
"" if delay is None else f" (timeout: {timedelta(seconds=delay)})",
)
variables = deepcopy(self._variables)
variables = {**self._variables}
self._variables["wait"] = {"remaining": delay, "trigger": None}
async def async_done(variables, context=None):