Skip to content

Commit 7dbc603

Browse files
authored
Update actions.md with iteration ckarification (#5521)
Clearer language for accessing the `iteration` parameter for the repeat action. Also update example to demonstrate how to use iteration.
1 parent b5e6f78 commit 7dbc603

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

content/automations/actions.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,16 +253,18 @@ on_...:
253253
- repeat:
254254
count: 5
255255
then:
256+
- lambda: ESP_LOGI("main", "Turning lights on for iteration [%d]", iteration);
256257
- light.turn_on: some_light
257258
- delay: 1s
259+
- lambda: ESP_LOGI("main", "Turning lights off for iteration [%d]", iteration);
258260
- light.turn_off: some_light
259261
- delay: 10s
260262
```
261263

262264
#### Configuration variables
263265

264266
- **count** (**Required**, int): The number of times the action should be repeated. The counter is available to
265-
lambdas using the reserved word "iteration".
267+
lambdas using the implicit script parameter `iteration`.
266268

267269
- **then** (**Required**, [Action](#config-action)): The action to repeat.
268270

0 commit comments

Comments
 (0)