Allow stopping a script with a response value (#95284)

This commit is contained in:
Paulus Schoutsen 2023-06-27 02:24:22 -04:00 committed by GitHub
parent 51aa2ba835
commit 5f14cdf69d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 140 additions and 28 deletions

View file

@ -59,6 +59,7 @@ from homeassistant.const import (
CONF_PARALLEL,
CONF_PLATFORM,
CONF_REPEAT,
CONF_RESPONSE,
CONF_RESPONSE_VARIABLE,
CONF_SCAN_INTERVAL,
CONF_SCENE,
@ -1689,7 +1690,11 @@ _SCRIPT_STOP_SCHEMA = vol.Schema(
{
**SCRIPT_ACTION_BASE_SCHEMA,
vol.Required(CONF_STOP): vol.Any(None, string),
vol.Optional(CONF_ERROR, default=False): boolean,
vol.Exclusive(CONF_ERROR, "error_or_response"): boolean,
vol.Exclusive(CONF_RESPONSE, "error_or_response"): vol.Any(
vol.All(dict, template_complex),
vol.All(str, template),
),
}
)