I have a blueprint with many branches which determine whether to activate certain scenes. I’m using a general sequence choose
block to determine which scene to activate based on the time of day, but this block is repeated in a few places.
A simplified pseudo blueprint example:
if triggered_by_motion_sensor:
if condition:
turn_on_lights()
elif triggered_by_switch:
if not condition:
turn_on_lights()
elif triggered_by_time:
if condition:
turn_on_lights()
Where turn_on_lights()
is a lengthly choose
block with many conditions.
I know that I could use or
and and
condition blocks to have the turn_on_lights()
sequence written only once, but I would prefer to keep the conditionals the way they are for the sake of clarity. I also know I could put this sequence in a script and call the script, but this defeats the purpose of using a blueprint instead of an automation.
Thus the question: Is there a way to store the turn_on_lights()
sequence block and call it to avoid repeating it either by storing in a variable or creating an anonymous script only available in the blueprinted automation?