Fix referenced objects in script sequences (#135499)

This commit is contained in:
Artur Pragacz
2025-01-13 11:40:53 +01:00
committed by GitHub
parent 2d67aca550
commit b009f11013
2 changed files with 54 additions and 0 deletions

View File

@@ -1589,6 +1589,9 @@ class Script:
target, referenced, script[CONF_SEQUENCE]
)
elif action == cv.SCRIPT_ACTION_SEQUENCE:
Script._find_referenced_target(target, referenced, step[CONF_SEQUENCE])
@cached_property
def referenced_devices(self) -> set[str]:
"""Return a set of referenced devices."""
@@ -1636,6 +1639,9 @@ class Script:
for script in step[CONF_PARALLEL]:
Script._find_referenced_devices(referenced, script[CONF_SEQUENCE])
elif action == cv.SCRIPT_ACTION_SEQUENCE:
Script._find_referenced_devices(referenced, step[CONF_SEQUENCE])
@cached_property
def referenced_entities(self) -> set[str]:
"""Return a set of referenced entities."""
@@ -1684,6 +1690,9 @@ class Script:
for script in step[CONF_PARALLEL]:
Script._find_referenced_entities(referenced, script[CONF_SEQUENCE])
elif action == cv.SCRIPT_ACTION_SEQUENCE:
Script._find_referenced_entities(referenced, step[CONF_SEQUENCE])
def run(
self, variables: _VarsType | None = None, context: Context | None = None
) -> None: