Skip to content

Commit d464ab8

Browse files
authored
Merge branch 'current' into current
2 parents 6ab80e1 + c054310 commit d464ab8

File tree

240 files changed

+6234
-3453
lines changed

Some content is hidden

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

240 files changed

+6234
-3453
lines changed

.devcontainer/devcontainer.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
// https://github.com/microsoft/vscode-dev-containers/tree/v0.183.0/containers/python-3
21
{
32
"name": "ESPHome - docs",
4-
"image": "mcr.microsoft.com/vscode/devcontainers/python:0-3.11",
3+
"image": "mcr.microsoft.com/devcontainers/python:3.12",
54
"postCreateCommand": ".devcontainer/postCreate.sh",
65
"postAttachCommand": "make live-html",
76
"forwardPorts": [8000],
@@ -10,10 +9,6 @@
109
},
1110
"customizations": {
1211
"vscode": {
13-
"settings": {
14-
"python.pythonPath": "/usr/local/bin/python"
15-
},
16-
1712
"extensions": ["ms-python.python"]
1813
}
1914
}

.github/workflows/check-labels.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Check labels
2+
3+
on:
4+
pull_request_target:
5+
types: [labeled, unlabeled]
6+
7+
jobs:
8+
check:
9+
name: Check
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Check labels
13+
uses: actions/github-script@v7.0.1
14+
with:
15+
script: |
16+
const { data: labels } = await github.rest.issues.listLabelsOnIssue({
17+
owner: context.repo.owner,
18+
repo: context.repo.repo,
19+
issue_number: context.issue.number
20+
});
21+
const hasParent = labels.find(label => label.name === "has-parent");
22+
const current = labels.find(label => label.name === "current");
23+
if (hasParent && current) {
24+
await github.rest.issues.addLabels({
25+
owner: context.repo.owner,
26+
repo: context.repo.repo,
27+
issue_number: context.issue.number,
28+
labels: ["wrong-base-branch"]
29+
});
30+
31+
await github.rest.pulls.createReview({
32+
pull_number: context.issue.number,
33+
owner: context.repo.owner,
34+
repo: context.repo.repo,
35+
event: "REQUEST_CHANGES",
36+
body: "As this is a feature matched with a PR in https://github.com/esphome/esphome, please target your PR to the `next` branch and rebase."
37+
});
38+
39+
core.setFailed("As this is a feature matched with a PR in https://github.com/esphome/esphome, please target your PR to the 'next' branch and rebase.");
40+
}

Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
44
curl \
55
git \
66
make \
7-
doxygen \
87
openssh-client \
98
software-properties-common \
109
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/*

Doxygen

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ PROJECT_NAME = "ESPHome"
3838
# could be handy for archiving the generated documentation or if some version
3939
# control system is used.
4040

41-
PROJECT_NUMBER = 2025.3.3
41+
PROJECT_NUMBER = 2025.5.0
4242

4343
# Using the PROJECT_BRIEF tag one can provide an optional one line description
4444
# for a project that appears at the top of each page and should give viewer a

Makefile

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
ESPHOME_PATH = ../esphome
2-
ESPHOME_REF = 2025.3.3
2+
ESPHOME_REF = 2025.5.1
33
PAGEFIND_VERSION=1.1.1
44
PAGEFIND=pagefind
55
NET_PAGEFIND=../pagefindbin/pagefind
66

7-
.PHONY: pagefind build-html html html-strict cleanhtml deploy help live-html live-pagefind Makefile netlify netlify-api api netlify-dependencies svg2png copy-svg2png minify
7+
.PHONY: pagefind build-html html html-strict cleanhtml deploy help live-html live-pagefind Makefile netlify netlify-dependencies svg2png copy-svg2png minify
88

99
html: pagefind
1010
sphinx-build -M html . _build -j auto -n $(O) -Dhtml_extra_path=_redirects,_pagefind
@@ -33,33 +33,13 @@ svg2png:
3333
help:
3434
sphinx-build -M help . _build $(O)
3535

36-
api:
37-
mkdir -p _build/html/api
38-
@if [ ! -d "$(ESPHOME_PATH)" ]; then \
39-
git clone --branch $(ESPHOME_REF) https://github.com/esphome/esphome.git $(ESPHOME_PATH) || \
40-
git clone --branch beta https://github.com/esphome/esphome.git $(ESPHOME_PATH); \
41-
fi
42-
ESPHOME_PATH=$(ESPHOME_PATH) doxygen Doxygen
43-
4436
net-html:
37+
sed -i 's@{{API_DOCS_URL}}@'"${API_DOCS_URL}"'@' _redirects
4538
sphinx-build -M html . _build -j auto -n $(O)
4639
mkdir -p _pagefind/pagefind
4740
${NET_PAGEFIND}
4841
sphinx-build -M html . _build -j auto -n $(O) -Dhtml_extra_path=_redirects,_pagefind
4942

50-
netlify-api: netlify-dependencies
51-
mkdir -p _build/html/api
52-
@if [ ! -d "$(ESPHOME_PATH)" ]; then \
53-
git clone --branch $(ESPHOME_REF) https://github.com/esphome/esphome.git $(ESPHOME_PATH) || \
54-
git clone --branch beta https://github.com/esphome/esphome.git $(ESPHOME_PATH); \
55-
fi
56-
ESPHOME_PATH=$(ESPHOME_PATH) ../doxybin/doxygen Doxygen
57-
58-
netlify-dependencies: pagefind-binary
59-
mkdir -p ../doxybin
60-
curl -L https://github.com/esphome/esphome-docs/releases/download/v1.10.1/doxygen-1.8.13.xz | xz -d >../doxybin/doxygen
61-
chmod +x ../doxybin/doxygen
62-
6343
pagefind-binary:
6444
mkdir -p ../pagefindbin
6545
curl -o pagefind.tar.gz https://github.com/CloudCannon/pagefind/releases/download/v$(PAGEFIND_VERSION)/pagefind-v$(PAGEFIND_VERSION)-x86_64-unknown-linux-musl.tar.gz -L
@@ -71,7 +51,7 @@ pagefind-binary:
7151
copy-svg2png:
7252
cp svg2png/*.png _build/html/_images/
7353

74-
netlify: netlify-dependencies netlify-api net-html copy-svg2png
54+
netlify: pagefind-binary net-html copy-svg2png
7555

7656
lint: html-strict
7757
python3 lint.py

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# ESPHome-Docs [![Netlify Status](https://api.netlify.com/api/v1/badges/97a2e9ce-cee7-4cc8-8dc7-537c92a23fa7/deploy-status)](https://app.netlify.com/sites/esphome/deploys) [![Discord Chat](https://img.shields.io/discord/429907082951524364.svg)](https://discord.gg/KhAMKrd) [![GitHub release](https://img.shields.io/github/release/esphome/esphome.svg)](https://github.com/esphome/esphome/releases/)
22

3-
[![ESPHome-Docs Logo](https://esphome.io/_images/logo-docs.png)](https://esphome.io/)
3+
<a href="https://esphome.io/">
4+
<picture>
5+
<source media="(prefers-color-scheme: dark)" srcset="https://esphome.io/_images/logo-docs-on-dark.svg", alt="ESPHome Logo">
6+
<img src="https://esphome.io/_images/logo-docs.svg" alt="ESPHome Logo">
7+
</picture>
8+
</a>
49

510
**Documentation:** https://esphome.io/
611

_extensions/apiref.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
import os
12
import re
23
import string
3-
from docutils import nodes, utils
44

5+
from docutils import nodes, utils
56

67
value_re = re.compile(r"^(.*)\s*<(.*)>$")
78
DOXYGEN_LOOKUP = {}
@@ -13,6 +14,8 @@
1314
DOXYGEN_LOOKUP["_"] = "__"
1415
DOXYGEN_LOOKUP["."] = "_8"
1516

17+
API_DOCS_URL = os.getenv("API_DOCS_URL", "https://api-docs.esphome.io")
18+
1619

1720
def split_text_value(value):
1821
match = value_re.match(value)
@@ -25,38 +28,42 @@ def encode_doxygen(value):
2528
value = value.split("/")[-1]
2629
try:
2730
return "".join(DOXYGEN_LOOKUP[s] for s in value)
28-
except KeyError:
29-
raise ValueError("Unknown character in doxygen string! '{}'".format(value))
31+
except KeyError as exc:
32+
raise ValueError(
33+
"Unknown character in doxygen string! '{}'".format(value)
34+
) from exc
3035

3136

3237
def apiref_role(name, rawtext, text, lineno, inliner, options=None, content=None):
3338
text, value = split_text_value(text)
3439
if text is None:
3540
text = "API Reference"
36-
ref = "/api/{}.html".format(encode_doxygen(value))
41+
ref = f"{API_DOCS_URL}/{encode_doxygen(value)}.html"
3742
return [make_link_node(rawtext, text, ref, options)], []
3843

3944

4045
def apiclass_role(name, rawtext, text, lineno, inliner, options=None, content=None):
4146
text, value = split_text_value(text)
4247
if text is None:
4348
text = value
44-
ref = "/api/classesphome_1_1{}.html".format(encode_doxygen(value))
49+
ref = f"{API_DOCS_URL}/classesphome_1_1{encode_doxygen(value)}.html"
4550
return [make_link_node(rawtext, text, ref, options)], []
4651

4752

4853
def apistruct_role(name, rawtext, text, lineno, inliner, options=None, content=None):
4954
text, value = split_text_value(text)
5055
if text is None:
5156
text = value
52-
ref = "/api/structesphome_1_1{}.html".format(encode_doxygen(value))
57+
ref = f"{API_DOCS_URL}/structesphome_1_1{encode_doxygen(value)}.html"
5358
return [make_link_node(rawtext, text, ref, options)], []
5459

60+
5561
def make_link_node(rawtext, text, ref, options=None):
5662
options = options or {}
5763
node = nodes.reference(rawtext, utils.unescape(text), refuri=ref, **options)
5864
return node
5965

66+
6067
def setup(app):
6168
app.add_role("apiref", apiref_role)
6269
app.add_role("apiclass", apiclass_role)

_redirects

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
/esphomeyaml/* /:splat 301
22

3+
# This redirect is for the api docs that have been moved.
4+
# It is replaced by sed in the makefile when netlify is building the site.
5+
/api/* {{API_DOCS_URL}}/:splat 301
6+
37
# Moved components
48
# e.g: /components/sensors/abc.html /components/sensors/xyz.html 301
59
/components/sensor/sgp40.html /components/sensor/sgp4x.html 301
@@ -14,19 +18,21 @@
1418
/components/sensor/mmc5063.html /components/sensor/mmc5603.html 301
1519
/components/sensor/kalman_combinator.html /components/sensor/combination.html 301
1620

17-
/components/binary_sensor/custom* /guides/contributing#a-note-about-custom-components 301
18-
/components/climate/custom* /guides/contributing#a-note-about-custom-components 301
19-
/components/cover/custom* /guides/contributing#a-note-about-custom-components 301
20-
/components/light/custom* /guides/contributing#a-note-about-custom-components 301
21-
/components/output/custom* /guides/contributing#a-note-about-custom-components 301
22-
/components/sensor/custom* /guides/contributing#a-note-about-custom-components 301
23-
/components/switch/custom* /guides/contributing#a-note-about-custom-components 301
24-
/components/text_sensor/custom* /guides/contributing#a-note-about-custom-components 301
25-
/custom/custom_component* /guides/contributing#a-note-about-custom-components 301
26-
/custom/i2c* /guides/contributing#a-note-about-custom-components 301
27-
/custom/index* /guides/contributing#a-note-about-custom-components 301
28-
/custom/spi* /guides/contributing#a-note-about-custom-components 301
29-
/custom/uart* /guides/contributing#a-note-about-custom-components 301
21+
/guides/contributing* https://developers.esphome.io/contributing/code/ 301
22+
23+
/components/binary_sensor/custom* https://developers.esphome.io/blog/2025/02/19/about-the-removal-of-support-for-custom-components/ 301
24+
/components/climate/custom* https://developers.esphome.io/blog/2025/02/19/about-the-removal-of-support-for-custom-components/ 301
25+
/components/cover/custom* https://developers.esphome.io/blog/2025/02/19/about-the-removal-of-support-for-custom-components/ 301
26+
/components/light/custom* https://developers.esphome.io/blog/2025/02/19/about-the-removal-of-support-for-custom-components/ 301
27+
/components/output/custom* https://developers.esphome.io/blog/2025/02/19/about-the-removal-of-support-for-custom-components/ 301
28+
/components/sensor/custom* https://developers.esphome.io/blog/2025/02/19/about-the-removal-of-support-for-custom-components/ 301
29+
/components/switch/custom* https://developers.esphome.io/blog/2025/02/19/about-the-removal-of-support-for-custom-components/ 301
30+
/components/text_sensor/custom* https://developers.esphome.io/blog/2025/02/19/about-the-removal-of-support-for-custom-components/ 301
31+
/custom/custom_component* https://developers.esphome.io/blog/2025/02/19/about-the-removal-of-support-for-custom-components/ 301
32+
/custom/i2c* https://developers.esphome.io/blog/2025/02/19/about-the-removal-of-support-for-custom-components/ 301
33+
/custom/index* https://developers.esphome.io/blog/2025/02/19/about-the-removal-of-support-for-custom-components/ 301
34+
/custom/spi* https://developers.esphome.io/blog/2025/02/19/about-the-removal-of-support-for-custom-components/ 301
35+
/custom/uart* https://developers.esphome.io/blog/2025/02/19/about-the-removal-of-support-for-custom-components/ 301
3036

3137
/cookbook/brilliant-mirabella-genio-smart-plugs.html https://devices.esphome.io/devices/Mirabella-Genio-Wi-Fi-1-USB 301
3238
/cookbook/zemismart-rgbw-downlights.html https://devices.esphome.io/devices/Zemismart-LED-RGBWW-Downlight 301

_static/changelog-2025.3.0.png

-79.2 KB
Loading

_static/changelog-2025.4.0.png

93.1 KB
Loading

0 commit comments

Comments
 (0)