Remove unnecessary assignment of Template.hass from script helper (#123780)

This commit is contained in:
Erik Montnemery 2024-08-13 11:55:37 +02:00 committed by GitHub
parent e9682fe003
commit 992de497f2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -669,7 +669,6 @@ class _ScriptRun:
trace_set_result(wait=self._variables["wait"])
wait_template = self._action[CONF_WAIT_TEMPLATE]
wait_template.hass = self._hass
# check if condition already okay
if condition.async_template(self._hass, wait_template, self._variables, False):
@ -1429,7 +1428,6 @@ class Script:
self._hass = hass
self.sequence = sequence
template.attach(hass, self.sequence)
self.name = name
self.unique_id = f"{domain}.{name}-{id(self)}"
self.domain = domain
@ -1459,8 +1457,6 @@ class Script:
self._sequence_scripts: dict[int, Script] = {}
self.variables = variables
self._variables_dynamic = template.is_complex(variables)
if self._variables_dynamic:
template.attach(hass, variables)
self._copy_variables_on_run = copy_variables
@property