mirror of
https://github.com/home-assistant/core.git
synced 2026-09-27 18:08:37 -04:00
Use modern condition API in script helper (#169355)
This commit is contained in:
@@ -702,7 +702,7 @@ class _ScriptRun:
|
||||
with trace_path(condition_path):
|
||||
for idx, cond in enumerate(conditions):
|
||||
with trace_path(str(idx)):
|
||||
if cond(hass, variables) is False:
|
||||
if cond.async_check(variables=variables) is False:
|
||||
return False
|
||||
except exceptions.ConditionError as ex:
|
||||
self._log(
|
||||
@@ -753,7 +753,7 @@ class _ScriptRun:
|
||||
trace_element = trace_stack_top(trace_stack_cv)
|
||||
if trace_element:
|
||||
trace_element.reuse_by_child = True
|
||||
check = cond(self._hass, self._variables)
|
||||
check = cond.async_check(variables=self._variables)
|
||||
except exceptions.ConditionError as ex:
|
||||
self._log("Error in 'condition' evaluation:\n%s", ex, level=logging.WARNING)
|
||||
check = False
|
||||
|
||||
Reference in New Issue
Block a user