Skip to content

Commit 7c8f495

Browse files
authored
Merge branch 'current' into dependabot/github_actions/docker/login-action-3.6.0
2 parents c67f82c + 720663f commit 7c8f495

File tree

647 files changed

+8697
-8418
lines changed

Some content is hidden

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

647 files changed

+8697
-8418
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/2022.1.0.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ With ESPHome Web we took the installation bits of the ESPHome dashboard and made
4444
over HTTPS. It works 100% in your browser without a backend or data leaving your computer. Now anyone can easily
4545
install ESPHome on their devices to get started.
4646

47-
`Visit ESPHome Web`_
47+
[Visit ESPHome Web](https://web.esphome.io)
4848

4949
## JSON
5050

content/changelog/2022.12.0.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,10 @@ of the performance increases for bluetooth, it is best to at least one serial fl
3232

3333
## Container images
3434

35-
{{< note >}}
36-
This breaking change only affects you if you use docker containers directly and specify the suffix
37-
in your image.
35+
> [!NOTE]
36+
> This breaking change only affects you if you use docker containers directly and specify the suffix
37+
> in your image.
3838
39-
{{< /note >}}
4039
2022.12.6 changes the way the container images are built and published. This is due to something
4140
breaking somewhere that we could not explain. It has to do with the `docker manifest` command
4241
which has been around for a while but always been marked as `experimental` so we cannot really

content/changelog/2023.12.0.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ This is a common source of issues and generally a pin does not need to be reused
3232
in a single configuration. Pins should only be reused in a very limited set of circumstances and seeing the
3333
error will generally mean that you need to reorganise your configuration to not reuse the pins.
3434
The error can be bypassed by specifically adding another config item to all of the
35-
duplicate pin definitions. See the [Pin Schema](#config-pin_schema) for details.
35+
duplicate pin definitions. See the [Pin Schema](/guides/configuration-types#pin-schema) for details.
3636

3737
## Touchscreen internal changes
3838

0 commit comments

Comments
 (0)