diff --git a/source/_docs/automation.markdown b/source/_docs/automation.markdown index a5826a63323..e337e081200 100644 --- a/source/_docs/automation.markdown +++ b/source/_docs/automation.markdown @@ -57,37 +57,30 @@ automation: ### Automation Modes -The automation's `mode` configuration option controls what happens when the automation is triggered while the actions are still running from a previous trigger. The default mode is `legacy`. +The automation's `mode` configuration option controls what happens when the automation is triggered while the actions are still running from a previous trigger. Mode | Description -|- -`legacy` | See [below](#legacy-mode). -`error` | Raise an error. Previous run continues normally. -`ignore` | Do not start a new run. Previous run continues normally. -`parallel` | Start a new, independent run in parallel with previous runs which continue normally. +`single` | Do not start a new run. Issue a warning. `restart` | Start a new run after first stopping previous run. -`queue` | Start a new run after all previous runs complete. Runs are guaranteed to execute in the order they were queued. The maximum number of queued up runs is controlled by the `queue_size` configuration option, which defaults to 10. +`queued` | Start a new run after all previous runs complete. Runs are guaranteed to execute in the order they were queued. +`parallel` | (Default) Start a new, independent run in parallel with previous runs. + +For both `queued` and `parallel` modes, configuration option `max` controls the maximum +number of runs that can be executing and/or queued up at a time. The default is 10. #### Example Setting Automation Mode ```yaml automation: - - mode: queue - queue_size: 5 - trigger: - ... + - trigger: + - ... + mode: queued + max: 25 + action: + - ... ``` -#### Legacy Mode - -
- -This mode is deprecated, and a warning to that effect will be issued at startup unless `mode: legacy` is specified. - -
- -This mode maintains the legacy script behavior. That is, the actions will run until a `delay` step, or a `wait_template` step (that actually waits) is executed, at which point the actions will suspend. If the automation is triggered while the actions are suspended, it will abort the delay/wait_template and continue immediately to the next step, or finish if there are no more steps. - ### Deleting Automations When automations remain visible in the Home Assistant Dashboard, even after having deleted in the YAML file, you have to delete them in the UI. diff --git a/source/_integrations/script.markdown b/source/_integrations/script.markdown index 9818d08ba5a..9f7dbe592e4 100644 --- a/source/_integrations/script.markdown +++ b/source/_integrations/script.markdown @@ -68,12 +68,12 @@ fields: description: An example value for PARAMETER_NAME. type: string mode: - description: "Controls what happens when script is run while it is still running from one or more previous invocations. See [Script Modes](#script-modes)." + description: "Controls what happens when script is invoked while it is still running from one or more previous invocations. See [Script Modes](#script-modes)." required: false type: string - default: legacy -queue_size: - description: "Controls maximum number of queued runs waiting for previous run to complete. Only valid with `mode: queue`." + default: single +max: + description: "Controls maximum number of runs executing and/or queued up to run at a time. Only valid with modes `queued` and `parallel`." required: false type: integer default: 10 @@ -87,27 +87,15 @@ sequence: Mode | Description -|- -`legacy` | See [below](#legacy-mode). -`error` | Raise an error. Previous run continues normally. -`ignore` | Do not start a new run. Previous run continues normally. -`parallel` | Start a new, independent run in parallel with previous runs which continue normally. +`single` | Do not start a new run. Issue a warning. `restart` | Start a new run after first stopping previous run. -`queue` | Start a new run after all previous runs complete. Runs are guaranteed to execute in the order they were queued. +`queued` | Start a new run after all previous runs complete. Runs are guaranteed to execute in the order they were queued. +`parallel` | Start a new, independent run in parallel with previous runs.

-#### Legacy Mode - -
- -This mode is deprecated, and a warning to that effect will be issued at startup unless `mode: legacy` is specified. - -
- -This mode maintains the legacy script behavior. That is, the script will run until it executes a `delay` step, or a `wait_template` step (that actually waits), at which point the script will suspend. If the script is run while suspended, it will abort the delay/wait_template and continue immediately to the next step, or finish if there are no more steps. Also, calling a legacy script that is still running (and not suspended) will result in an error. - ### Full Configuration {% raw %} @@ -240,11 +228,3 @@ script: # Do some things at the same time as the first script... ``` {% endraw %} - -Note that this is only guaranteed to work if the called script uses a non-legacy mode. - -### In the Overview - -Legacy scripts in the Overview panel will be displayed with an **EXECUTE** button if the script has no `delay:` or `wait_template:` statement, and as a toggle switch if it has either of those. Scripts configured for any other mode than `legacy` will also be displayed with a toggle switch. - -This is to enable you to stop a running script. diff --git a/source/images/integrations/script/script_figures.pptx b/source/images/integrations/script/script_figures.pptx index 378a4204579..4a9925f88a4 100644 Binary files a/source/images/integrations/script/script_figures.pptx and b/source/images/integrations/script/script_figures.pptx differ diff --git a/source/images/integrations/script/script_modes.jpg b/source/images/integrations/script/script_modes.jpg index 910105610d9..e9eae2bc3ee 100644 Binary files a/source/images/integrations/script/script_modes.jpg and b/source/images/integrations/script/script_modes.jpg differ