[script] Fix array-type parameters in script.execute (#16374)

This commit is contained in:
J. Nick Koston
2026-05-12 12:17:23 -05:00
committed by GitHub
parent 365ed19319
commit 727c74da3f
4 changed files with 125 additions and 0 deletions
+16
View File
@@ -7,6 +7,12 @@ esphome:
prefix: "Test"
param2: 0
param3: true
- script.execute:
id: my_script_with_array_params
ints: [42, 100]
floats: [1.5, 2.5]
bools: [true, false]
strings: ["a", "b"]
- script.wait: my_script
- script.stop: my_script
- if:
@@ -34,6 +40,16 @@ script:
mode: restart
then:
- lambda: 'ESP_LOGD("main", "Hello World!");'
- id: my_script_with_array_params
parameters:
ints: int[]
floats: float[]
bools: bool[]
strings: string[]
then:
- lambda: |-
ESP_LOGD("main", "ints=%d floats=%f bools=%d strings=%s",
ints[0], floats[0], bools[0], strings[0].c_str());
- id: my_script_with_params
parameters:
prefix: string