Skip to content

Commit 388d122

Browse files
authored
Merge branch 'current' into dependabot/github_actions/dessant/lock-threads-5.0.1
2 parents 1167d5e + 720663f commit 388d122

File tree

695 files changed

+8940
-10323
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

695 files changed

+8940
-10323
lines changed

.github/workflows/component-image.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,20 @@ jobs:
3232
3333
- name: Get Component name
3434
id: get_component
35-
run: |-
36-
comment="${{ github.event.comment.body }}"
37-
component=$(echo $comment | sed -n 's/^@esphomebot generate image //p')
38-
echo "name=$component" >> $GITHUB_OUTPUT
39-
echo "name_lower=${component,,}" >> $GITHUB_OUTPUT
35+
env:
36+
COMMENT_BODY: ${{ github.event.comment.body }}
37+
run: |
38+
# Extract component name using bash parameter expansion (no external commands)
39+
component="${COMMENT_BODY#@esphomebot generate image }"
40+
41+
# Validate component name: only lowercase alphanumeric and underscores
42+
if [[ "$component" =~ ^[a-z0-9_]+$ ]]; then
43+
echo "name=$component" >> $GITHUB_OUTPUT
44+
echo "name_lower=${component,,}" >> $GITHUB_OUTPUT
45+
else
46+
echo "::error::Invalid component name. Must contain only lowercase letters, numbers, and underscores."
47+
exit 1
48+
fi
4049
4150
generate:
4251
name: Generate
@@ -50,7 +59,7 @@ jobs:
5059
component: ${{ needs.prepare.outputs.name }}
5160

5261
- name: Upload
53-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
62+
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
5463
id: upload-artifact
5564
with:
5665
name: ${{ needs.prepare.outputs.name }}

.github/workflows/stale.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
stale:
1717
runs-on: ubuntu-latest
1818
steps:
19-
- uses: actions/stale@3a9db7e6a41a89f618792c92c0e97cc736e1b13f # v10
19+
- uses: actions/stale@5f858e3efba33a5ca4407a664cc011ad407f2008 # v10
2020
with:
2121
days-before-pr-stale: 60
2222
days-before-pr-close: 7

.markdownlintrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"MD024": {
88
"siblings_only": true
99
},
10+
"MD028": false,
1011
"MD029": {
1112
"style": "one"
1213
},

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ FROM python:3.13-slim
33
RUN apt-get update && apt-get install -y --no-install-recommends \
44
curl \
55
git \
6+
jq \
67
make \
78
openssh-client \
89
hugo \

content/automations/_index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ params:
77
image: auto-fix.svg
88
---
99

10+
{{< anchor "automation" >}}
11+
1012
Automations are a very powerful aspect of ESPHome; they allow you to easily perform actions given some condition(s).
1113

1214
When you want your ESPHome device to respond to its environment, you use an automation. Here are some examples:

content/automations/actions.md

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ switch:
6262
id: dehumidifier1
6363
```
6464
65-
First, we have to give the dehumidifier `switch` an [ID](#config-id) so that we can refer to it inside of our
65+
First, we have to give the dehumidifier `switch` an [ID](/guides/configuration-types#id) so that we can refer to it inside of our
6666
automation.
6767

6868
{{< anchor "actions-trigger" >}}
@@ -178,11 +178,10 @@ on_...:
178178
- delay: !lambda "if (id(reed_switch).state) return 1000; else return 0;"
179179
```
180180

181-
{{< note >}}
182-
This is a "smart" asynchronous delay - other code will still run in the background while
183-
the delay is happening. When using a lambda call, you should return the delay value in milliseconds.
181+
> [!NOTE]
182+
> This is a "smart" asynchronous delay - other code will still run in the background while
183+
> the delay is happening. When using a lambda call, you should return the delay value in milliseconds.
184184

185-
{{< /note >}}
186185
{{< anchor "if_action" >}}
187186

188187
### `if` Action
@@ -214,19 +213,19 @@ on_...:
214213

215214
At least one of `condition`, `all` or `any` must be provided.
216215

217-
- **condition** (*Optional*, [Condition](#config-condition)): The condition to check to determine which branch to take.
216+
- **condition** (*Optional*, [Condition](#all-conditions)): The condition to check to determine which branch to take.
218217
If this is configured with a list of conditions then they must all be true for the condition to be true.
219218

220-
- **all** (*Optional*, [Condition](#config-condition)): Takes a list of conditions, all of which must be true (and is
219+
- **all** (*Optional*, [Condition](#all-conditions)): Takes a list of conditions, all of which must be true (and is
221220
therefore equivalent to `condition` .)
222221

223-
- **any** (*Optional*, [Condition](#config-condition)): Takes a list of conditions; if at least one is true, the
222+
- **any** (*Optional*, [Condition](#all-conditions)): Takes a list of conditions; if at least one is true, the
224223
condition will be true.
225224

226-
- **then** (*Optional*, [Action](#config-action)): The action to perform if the condition evaluates to true.
225+
- **then** (*Optional*, [Action](#all-actions)): The action to perform if the condition evaluates to true.
227226
Defaults to doing nothing.
228227

229-
- **else** (*Optional*, [Action](#config-action)): The action to perform if the condition evaluates to false.
228+
- **else** (*Optional*, [Action](#all-actions)): The action to perform if the condition evaluates to false.
230229
Defaults to doing nothing.
231230

232231
{{< anchor "lambda_action" >}}
@@ -254,18 +253,20 @@ on_...:
254253
- repeat:
255254
count: 5
256255
then:
256+
- lambda: ESP_LOGI("main", "Turning lights on for iteration [%d]", iteration);
257257
- light.turn_on: some_light
258258
- delay: 1s
259+
- lambda: ESP_LOGI("main", "Turning lights off for iteration [%d]", iteration);
259260
- light.turn_off: some_light
260261
- delay: 10s
261262
```
262263

263264
#### Configuration variables
264265

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

268-
- **then** (**Required**, [Action](#config-action)): The action to repeat.
269+
- **then** (**Required**, [Action](#all-actions)): The action to repeat.
269270

270271
{{< anchor "wait_until_action" >}}
271272

@@ -298,8 +299,8 @@ on_...:
298299

299300
#### Configuration variables
300301

301-
- **condition** (**Required**, [Condition](#config-condition)): The condition to wait to become true.
302-
- **timeout** (*Optional*, [Time](#config-time)): Time to wait before timing out. Defaults to never timing out.
302+
- **condition** (**Required**, [Condition](#all-conditions)): The condition to wait to become true.
303+
- **timeout** (*Optional*, [Time](/guides/configuration-types#time)): Time to wait before timing out. Defaults to never timing out.
303304

304305
{{< anchor "while_action" >}}
305306

@@ -322,10 +323,10 @@ on_...:
322323

323324
#### Configuration variables
324325

325-
- **condition** (**Required**, [Condition](#config-condition)): The condition to check to determine whether or not to
326+
- **condition** (**Required**, [Condition](#all-conditions)): The condition to check to determine whether or not to
326327
execute.
327328

328-
- **then** (**Required**, [Action](#config-action)): The action to perform until the condition evaluates to false.
329+
- **then** (**Required**, [Action](#all-actions)): The action to perform until the condition evaluates to false.
329330

330331
{{< anchor "component-update_action" >}}
331332

@@ -456,10 +457,10 @@ on_...:
456457

457458
#### Configuration variables
458459

459-
- **time** (**Required**, [templatable](#config-templatable), [Time](#config-time)):
460+
- **time** (**Required**, [templatable](/automations/templates), [Time](/guides/configuration-types#time)):
460461
The time for which the condition has to have been true.
461462

462-
- **condition** (**Required**, [condition](#config-condition)): The condition to check.
463+
- **condition** (**Required**, [condition](#all-conditions)): The condition to check.
463464

464465
{{< anchor "lambda_condition" >}}
465466

content/automations/templates.md

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -55,25 +55,23 @@ Finally, `id(...)` is a helper function that makes ESPHome fetch an object with
5555
somewhere else, like `top_end_stop` ) and lets you call any of ESPHome's many APIs directly. For example, here we're
5656
retrieving the current state of the end stop using `.state` and using it to construct our cover state.
5757

58-
{{< note >}}
59-
ESPHome does not check the validity of lambda expressions you enter and will blindly copy them into the generated
60-
C++ code. If compilation fails or something else is not working as expected with lambdas, it's always best to look
61-
at the generated C++ source file under `<NODE_NAME>/src/main.cpp`.
58+
> [!NOTE]
59+
> ESPHome does not check the validity of lambda expressions you enter and will blindly copy them into the generated
60+
> C++ code. If compilation fails or something else is not working as expected with lambdas, it's always best to look
61+
> at the generated C++ source file under `<NODE_NAME>/src/main.cpp`.
62+
63+
> [!TIP]
64+
> To store local variables inside lambdas that retain their value across executions, you can create `static`
65+
> variables as shown in the example below. Here, the variable `num_executions` is incremented by one each time the
66+
> lambda is executed and the current value is logged.
67+
>
68+
> ```yaml
69+
> lambda: |-
70+
> static int num_executions = 0;
71+
> ESP_LOGD("main", "I am at execution number %d", num_executions);
72+
> num_executions += 1;
73+
> ```
6274

63-
{{< /note >}}
64-
{{< tip >}}
65-
To store local variables inside lambdas that retain their value across executions, you can create `static`
66-
variables as shown in the example below. Here, the variable `num_executions` is incremented by one each time the
67-
lambda is executed and the current value is logged.
68-
69-
```yaml
70-
lambda: |-
71-
static int num_executions = 0;
72-
ESP_LOGD("main", "I am at execution number %d", num_executions);
73-
num_executions += 1;
74-
```
75-
76-
{{< /tip >}}
7775
{{< anchor "config-templatable" >}}
7876

7977
## Templating Actions

content/changelog/2021.10.0.md

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -421,21 +421,6 @@ the end resut value was being calculated incorrectly. {{< pr number="2368" repo=
421421

422422
<!-- markdownlint-enable MD013 -->
423423

424-
## Past Changelogs
425-
426-
- {{< docref "2021.9.0/" >}}
427-
- {{< docref "2021.8.0/" >}}
428-
- {{< docref "v1.20.0/" >}}
429-
- {{< docref "v1.19.0/" >}}
430-
- {{< docref "v1.18.0/" >}}
431-
- {{< docref "v1.17.0/" >}}
432-
- {{< docref "v1.16.0/" >}}
433-
- {{< docref "v1.15.0/" >}}
434-
- {{< docref "v1.14.0/" >}}
435-
- {{< docref "v1.13.0/" >}}
436-
- {{< docref "v1.12.0/" >}}
437-
- {{< docref "v1.11.0/" >}}
438-
- {{< docref "v1.10.0/" >}}
439-
- {{< docref "v1.9.0/" >}}
440-
- {{< docref "v1.8.0/" >}}
441-
- {{< docref "v1.7.0/" >}}
424+
## All Changelogs
425+
426+
{{< changelogs >}}

content/changelog/2021.11.0.md

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -287,22 +287,6 @@ the community.
287287

288288
<!-- markdownlint-enable MD013 -->
289289

290-
## Past Changelogs
291-
292-
- {{< docref "2021.10.0/" >}}
293-
- {{< docref "2021.9.0/" >}}
294-
- {{< docref "2021.8.0/" >}}
295-
- {{< docref "v1.20.0/" >}}
296-
- {{< docref "v1.19.0/" >}}
297-
- {{< docref "v1.18.0/" >}}
298-
- {{< docref "v1.17.0/" >}}
299-
- {{< docref "v1.16.0/" >}}
300-
- {{< docref "v1.15.0/" >}}
301-
- {{< docref "v1.14.0/" >}}
302-
- {{< docref "v1.13.0/" >}}
303-
- {{< docref "v1.12.0/" >}}
304-
- {{< docref "v1.11.0/" >}}
305-
- {{< docref "v1.10.0/" >}}
306-
- {{< docref "v1.9.0/" >}}
307-
- {{< docref "v1.8.0/" >}}
308-
- {{< docref "v1.7.0/" >}}
290+
## All Changelogs
291+
292+
{{< changelogs >}}

content/changelog/2021.12.0.md

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -247,23 +247,6 @@ for the new configuration options.
247247

248248
<!-- markdownlint-enable MD013 -->
249249

250-
## Past Changelogs
251-
252-
- {{< docref "2021.11.0/" >}}
253-
- {{< docref "2021.10.0/" >}}
254-
- {{< docref "2021.9.0/" >}}
255-
- {{< docref "2021.8.0/" >}}
256-
- {{< docref "v1.20.0/" >}}
257-
- {{< docref "v1.19.0/" >}}
258-
- {{< docref "v1.18.0/" >}}
259-
- {{< docref "v1.17.0/" >}}
260-
- {{< docref "v1.16.0/" >}}
261-
- {{< docref "v1.15.0/" >}}
262-
- {{< docref "v1.14.0/" >}}
263-
- {{< docref "v1.13.0/" >}}
264-
- {{< docref "v1.12.0/" >}}
265-
- {{< docref "v1.11.0/" >}}
266-
- {{< docref "v1.10.0/" >}}
267-
- {{< docref "v1.9.0/" >}}
268-
- {{< docref "v1.8.0/" >}}
269-
- {{< docref "v1.7.0/" >}}
250+
## All Changelogs
251+
252+
{{< changelogs >}}

0 commit comments

Comments
 (0)