Skip to content

Commit ebbc661

Browse files
committed
Merge branch 'guide_for_noobs' of https://github.com/trip5/esphome-docs into guide_for_noobs
2 parents 6eaf4dc + 42b5b79 commit ebbc661

File tree

213 files changed

+3557
-979
lines changed

Some content is hidden

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

213 files changed

+3557
-979
lines changed

.github/workflows/component-image.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
component: ${{ needs.prepare.outputs.name }}
5151

5252
- name: Upload
53-
uses: actions/upload-artifact@v4.4.3
53+
uses: actions/upload-artifact@v4.5.0
5454
id: upload-artifact
5555
with:
5656
name: ${{ needs.prepare.outputs.name }}

.github/workflows/docker.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
steps:
2626
-
2727
name: Install pagefind
28-
uses: jaxxstorm/action-install-gh-release@v1.12.0
28+
uses: jaxxstorm/action-install-gh-release@v1.14.0
2929
with:
3030
repo: cloudcannon/pagefind
3131
-

.github/workflows/lint.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
runs-on: ubuntu-latest
2121
steps:
2222
- name: Install pagefind
23-
uses: jaxxstorm/action-install-gh-release@v1.12.0
23+
uses: jaxxstorm/action-install-gh-release@v1.14.0
2424
with:
2525
repo: cloudcannon/pagefind
2626
- uses: actions/[email protected]

Doxygen

+1-1
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 = 2024.10.3
41+
PROJECT_NUMBER = 2024.12.2
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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
ESPHOME_PATH = ../esphome
2-
ESPHOME_REF = 2024.10.3
2+
ESPHOME_REF = 2024.12.2
33
PAGEFIND_VERSION=1.1.1
44
PAGEFIND=pagefind
55
NET_PAGEFIND=../pagefindbin/pagefind

_extensions/apiref.py

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
import re
2+
import string
3+
from docutils import nodes, utils
4+
5+
6+
value_re = re.compile(r"^(.*)\s*<(.*)>$")
7+
DOXYGEN_LOOKUP = {}
8+
for s in string.ascii_lowercase + string.digits:
9+
DOXYGEN_LOOKUP[s] = s
10+
for s in string.ascii_uppercase:
11+
DOXYGEN_LOOKUP[s] = "_{}".format(s.lower())
12+
DOXYGEN_LOOKUP[":"] = "_1"
13+
DOXYGEN_LOOKUP["_"] = "__"
14+
DOXYGEN_LOOKUP["."] = "_8"
15+
16+
17+
def split_text_value(value):
18+
match = value_re.match(value)
19+
if match is None:
20+
return None, value
21+
return match.group(1), match.group(2)
22+
23+
24+
def encode_doxygen(value):
25+
value = value.split("/")[-1]
26+
try:
27+
return "".join(DOXYGEN_LOOKUP[s] for s in value)
28+
except KeyError:
29+
raise ValueError("Unknown character in doxygen string! '{}'".format(value))
30+
31+
32+
def apiref_role(name, rawtext, text, lineno, inliner, options=None, content=None):
33+
text, value = split_text_value(text)
34+
if text is None:
35+
text = "API Reference"
36+
ref = "/api/{}.html".format(encode_doxygen(value))
37+
return [make_link_node(rawtext, text, ref, options)], []
38+
39+
40+
def apiclass_role(name, rawtext, text, lineno, inliner, options=None, content=None):
41+
text, value = split_text_value(text)
42+
if text is None:
43+
text = value
44+
ref = "/api/classesphome_1_1{}.html".format(encode_doxygen(value))
45+
return [make_link_node(rawtext, text, ref, options)], []
46+
47+
48+
def apistruct_role(name, rawtext, text, lineno, inliner, options=None, content=None):
49+
text, value = split_text_value(text)
50+
if text is None:
51+
text = value
52+
ref = "/api/structesphome_1_1{}.html".format(encode_doxygen(value))
53+
return [make_link_node(rawtext, text, ref, options)], []
54+
55+
def make_link_node(rawtext, text, ref, options=None):
56+
options = options or {}
57+
node = nodes.reference(rawtext, utils.unescape(text), refuri=ref, **options)
58+
return node
59+
60+
def setup(app):
61+
app.add_role("apiref", apiref_role)
62+
app.add_role("apiclass", apiclass_role)
63+
app.add_role("apistruct", apistruct_role)
64+
return {"version": "1.0.0", "parallel_read_safe": True, "parallel_write_safe": True}
File renamed without changes.

_extensions/github.py

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
2+
import os
3+
4+
from docutils import nodes, utils
5+
6+
7+
def libpr_role(name, rawtext, text, lineno, inliner, options=None, content=None):
8+
ref = "https://github.com/esphome/esphome-core/pull/{}".format(text)
9+
return [make_link_node(rawtext, "core#{}".format(text), ref, options)], []
10+
11+
12+
def yamlpr_role(name, rawtext, text, lineno, inliner, options=None, content=None):
13+
ref = "https://github.com/esphome/esphome/pull/{}".format(text)
14+
return [make_link_node(rawtext, "esphome#{}".format(text), ref, options)], []
15+
16+
17+
def docspr_role(name, rawtext, text, lineno, inliner, options=None, content=None):
18+
ref = "https://github.com/esphome/esphome-docs/pull/{}".format(text)
19+
return [make_link_node(rawtext, "docs#{}".format(text), ref, options)], []
20+
21+
22+
def ghuser_role(name, rawtext, text, lineno, inliner, options=None, content=None):
23+
ref = "https://github.com/{}".format(text)
24+
return [make_link_node(rawtext, "@{}".format(text), ref, options)], []
25+
26+
27+
def ghedit_role(name, rawtext, text, lineno, inliner, options=None, content=None):
28+
path = os.path.relpath(
29+
inliner.document.current_source, inliner.document.settings.env.app.srcdir
30+
)
31+
ref = "https://github.com/esphome/esphome-docs/blob/current/{}".format(path)
32+
return [make_link_node(rawtext, "Edit this page on GitHub", ref, options)], []
33+
34+
35+
def make_link_node(rawtext, text, ref, options=None):
36+
options = options or {}
37+
node = nodes.reference(rawtext, utils.unescape(text), refuri=ref, **options)
38+
return node
39+
40+
41+
def setup(app):
42+
app.add_role("libpr", libpr_role)
43+
app.add_role("corepr", libpr_role)
44+
app.add_role("yamlpr", yamlpr_role)
45+
app.add_role("esphomepr", yamlpr_role)
46+
app.add_role("docspr", docspr_role)
47+
app.add_role("ghuser", ghuser_role)
48+
app.add_role("ghedit", ghedit_role)
49+
return {"version": "1.0.0", "parallel_read_safe": True, "parallel_write_safe": True}

seo.py renamed to _extensions/seo.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def run(self):
129129
if not image.startswith("/"):
130130
local_img = f"/images/{image}"
131131
image = "/_images/" + image
132-
p = Path(__file__).parent / local_img[1:]
132+
p = Path(__file__).parent.parent / local_img[1:]
133133
if not p.is_file():
134134
raise ValueError(f"File {p} for seo tag does not exist {self.state.document}")
135135

File renamed without changes.

github.py renamed to _extensions/tables.py

+1-99
Original file line numberDiff line numberDiff line change
@@ -1,98 +1,11 @@
1+
12
import csv
23
from itertools import zip_longest
3-
import os
4-
import re
5-
import string
64

75
from docutils import nodes, utils
86
from docutils.parsers.rst import directives
97
from docutils.parsers.rst.directives.tables import Table
108

11-
12-
def libpr_role(name, rawtext, text, lineno, inliner, options=None, content=None):
13-
ref = "https://github.com/esphome/esphome-core/pull/{}".format(text)
14-
return [make_link_node(rawtext, "core#{}".format(text), ref, options)], []
15-
16-
17-
def yamlpr_role(name, rawtext, text, lineno, inliner, options=None, content=None):
18-
ref = "https://github.com/esphome/esphome/pull/{}".format(text)
19-
return [make_link_node(rawtext, "esphome#{}".format(text), ref, options)], []
20-
21-
22-
def docspr_role(name, rawtext, text, lineno, inliner, options=None, content=None):
23-
ref = "https://github.com/esphome/esphome-docs/pull/{}".format(text)
24-
return [make_link_node(rawtext, "docs#{}".format(text), ref, options)], []
25-
26-
27-
def ghuser_role(name, rawtext, text, lineno, inliner, options=None, content=None):
28-
ref = "https://github.com/{}".format(text)
29-
return [make_link_node(rawtext, "@{}".format(text), ref, options)], []
30-
31-
32-
value_re = re.compile(r"^(.*)\s*<(.*)>$")
33-
DOXYGEN_LOOKUP = {}
34-
for s in string.ascii_lowercase + string.digits:
35-
DOXYGEN_LOOKUP[s] = s
36-
for s in string.ascii_uppercase:
37-
DOXYGEN_LOOKUP[s] = "_{}".format(s.lower())
38-
DOXYGEN_LOOKUP[":"] = "_1"
39-
DOXYGEN_LOOKUP["_"] = "__"
40-
DOXYGEN_LOOKUP["."] = "_8"
41-
42-
43-
def split_text_value(value):
44-
match = value_re.match(value)
45-
if match is None:
46-
return None, value
47-
return match.group(1), match.group(2)
48-
49-
50-
def encode_doxygen(value):
51-
value = value.split("/")[-1]
52-
try:
53-
return "".join(DOXYGEN_LOOKUP[s] for s in value)
54-
except KeyError:
55-
raise ValueError("Unknown character in doxygen string! '{}'".format(value))
56-
57-
58-
def apiref_role(name, rawtext, text, lineno, inliner, options=None, content=None):
59-
text, value = split_text_value(text)
60-
if text is None:
61-
text = "API Reference"
62-
ref = "/api/{}.html".format(encode_doxygen(value))
63-
return [make_link_node(rawtext, text, ref, options)], []
64-
65-
66-
def apiclass_role(name, rawtext, text, lineno, inliner, options=None, content=None):
67-
text, value = split_text_value(text)
68-
if text is None:
69-
text = value
70-
ref = "/api/classesphome_1_1{}.html".format(encode_doxygen(value))
71-
return [make_link_node(rawtext, text, ref, options)], []
72-
73-
74-
def apistruct_role(name, rawtext, text, lineno, inliner, options=None, content=None):
75-
text, value = split_text_value(text)
76-
if text is None:
77-
text = value
78-
ref = "/api/structesphome_1_1{}.html".format(encode_doxygen(value))
79-
return [make_link_node(rawtext, text, ref, options)], []
80-
81-
82-
def ghedit_role(name, rawtext, text, lineno, inliner, options=None, content=None):
83-
path = os.path.relpath(
84-
inliner.document.current_source, inliner.document.settings.env.app.srcdir
85-
)
86-
ref = "https://github.com/esphome/esphome-docs/blob/current/{}".format(path)
87-
return [make_link_node(rawtext, "Edit this page on GitHub", ref, options)], []
88-
89-
90-
def make_link_node(rawtext, text, ref, options=None):
91-
options = options or {}
92-
node = nodes.reference(rawtext, utils.unescape(text), refuri=ref, **options)
93-
return node
94-
95-
969
# https://stackoverflow.com/a/3415150/8924614
9710
def grouper(n, iterable, fillvalue=None):
9811
"""Pythonic way to iterate over sequence, 4 items at a time.
@@ -105,7 +18,6 @@ def grouper(n, iterable, fillvalue=None):
10518

10619
# Based on https://www.slideshare.net/doughellmann/better-documentation-through-automation-creating-docutils-sphinx-extensions
10720
class ImageTableDirective(Table):
108-
10921
option_spec = {
11022
"columns": directives.positive_int,
11123
}
@@ -272,16 +184,6 @@ def run(self):
272184

273185

274186
def setup(app):
275-
app.add_role("libpr", libpr_role)
276-
app.add_role("corepr", libpr_role)
277-
app.add_role("yamlpr", yamlpr_role)
278-
app.add_role("esphomepr", yamlpr_role)
279-
app.add_role("docspr", docspr_role)
280-
app.add_role("ghuser", ghuser_role)
281-
app.add_role("apiref", apiref_role)
282-
app.add_role("apiclass", apiclass_role)
283-
app.add_role("apistruct", apistruct_role)
284-
app.add_role("ghedit", ghedit_role)
285187
app.add_directive("imgtable", ImageTableDirective)
286188
app.add_directive("pintable", PinTableDirective)
287189
return {"version": "1.0.0", "parallel_read_safe": True, "parallel_write_safe": True}

_redirects

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
/components/ota.html /components/ota/esphome.html 301
1313
/components/ota_http_request.html /components/ota/http_request.html 301
1414
/components/sensor/mmc5063.html /components/sensor/mmc5603.html 301
15+
/components/sensor/kalman_combinator.html /components/sensor/combination.html 301
1516

1617
/cookbook/brilliant-mirabella-genio-smart-plugs.html https://devices.esphome.io/devices/Mirabella-Genio-Wi-Fi-1-USB 301
1718
/cookbook/zemismart-rgbw-downlights.html https://devices.esphome.io/devices/Zemismart-LED-RGBWW-Downlight 301
@@ -42,3 +43,4 @@
4243

4344
/ready-made/projects /projects/ 301
4445
/components/images /components/image 301
46+
/components/display/qspi_amoled.html /components/display/qspi_dbi.html 301

_static/changelog-2024.10.0.png

-24.8 KB
Loading

_static/changelog-2024.11.0.png

153 KB
Loading

_static/changelog-2024.12.0.png

152 KB
Loading

_static/changelog-2024.9.0.png

-22.5 KB
Loading

_static/version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2024.10.3
1+
2024.12.2

automations/actions.rst

+15-7
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,11 @@ turns on a light for 5 seconds. Otherwise, the light is turned off immediately.
217217
218218
Configuration variables:
219219

220-
- **condition** (**Required**, :ref:`Condition <config-condition>`): The condition to check to determine which branch to take.
220+
At least one of ``condition``, ``all`` or ``any`` must be provided.
221+
222+
- **condition** (*Optional*, :ref:`Condition <config-condition>`): The condition to check to determine which branch to take. If this is configured with a list of conditions then they must all be true for the condition to be true.
223+
- **all** (*Optional*, :ref:`Condition <config-condition>`): Takes a list of conditions, all of which must be true (and is therefore equivalent to ``condition``.)
224+
- **any** (*Optional*, :ref:`Condition <config-condition>`): Takes a list of conditions; if at least one is true, the condition will be true.
221225
- **then** (*Optional*, :ref:`Action <config-action>`): The action to perform if the condition evaluates to true.
222226
Defaults to doing nothing.
223227
- **else** (*Optional*, :ref:`Action <config-action>`): The action to perform if the condition evaluates to false.
@@ -406,14 +410,17 @@ Common Conditions
406410
"Conditions" provide a way for your device to take an action only when a specific (set of) condition(s) is satisfied.
407411

408412
.. _and_condition:
413+
.. _all_condition:
409414
.. _or_condition:
415+
.. _any_condition:
410416
.. _xor_condition:
411417
.. _not_condition:
412418

413-
``and`` / ``or`` / ``xor`` / ``not`` Condition
414-
**********************************************
419+
``and`` / ``all`` / ``or`` / ``any`` / ``xor`` / ``not`` Condition
420+
******************************************************************
415421

416-
Check a combination of conditions
422+
Check a combination of conditions. ``all`` is a synonym for ``and``, and ``any`` is a synonym for ``or``.
423+
``all`` and ``any`` may also be used directly in place of ``condition``.
417424

418425
.. code-block:: yaml
419426
@@ -428,9 +435,10 @@ Check a combination of conditions
428435
# ...
429436
430437
- if:
431-
condition:
432-
not:
433-
binary_sensor.is_off: some_binary_sensor
438+
any:
439+
- not:
440+
binary_sensor.is_off: some_binary_sensor
441+
- binary_sensor.is_on: some_other_sensor
434442
435443
.. _for_condition:
436444

automations/all_actions.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
- **senseair:** ``abc_disable``, ``abc_enable``, ``abc_get_period``, ``background_calibration``, ``background_calibration_result``
5858
- **servo:** ``detach``, ``write``
5959
- **sim800l:** ``connect``, ``dial``, ``disconnect``, ``send_sms``, ``send_ussd``
60-
- **speaker:** ``play``, ``stop``
60+
- **speaker:** ``play``, ``stop``, ``finish``, ``volume_set``
6161
- **sprinkler:** ``clear_queued_valves``, ``next_valve``, ``pause``, ``previous_valve``, ``queue_valve``, ``resume``, ``resume_or_start_full_cycle``, ``set_divider``, ``set_multiplier``, ``set_repeat``, ``set_valve_run_duration``, ``shutdown``, ``start_from_queue``, ``start_full_cycle``, ``start_single_valve``
6262
- **sps30:** ``start_fan_autoclean``
6363
- **stepper:** ``report_position``, ``set_acceleration``, ``set_deceleration``, ``set_speed``, ``set_target``

automations/all_conditions.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
- **fan:** ``is_off``, ``is_on``
99
- **light:** ``is_off``, ``is_on``
1010
- **lock:** ``is_locked``, ``is_unlocked``
11-
- **media_player:** ``is_idle``, ``is_playing``
11+
- **media_player:** ``is_announcing``, ``is_idle``, ``is_paused``, ``is_playing``
1212
- **micro_wake_word:** ``is_running``
1313
- **microphone:** ``is_capturing``
1414
- **mqtt:** ``connected``

changelog/2022.1.0.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ ESPHome 2022.1.0 - 19th January 2022
2020
Kalman Combinator, components/sensor/kalman_combinator, function.svg, dark-invert
2121
MCP3204, components/sensor/mcp3204, mcp3204.jpg
2222
MCP47A1, components/output/mcp47a1, mcp47a1.svg
23-
Midea IR Climate, components/climate/ir_climate, air-conditioner-ir.svg, dark-invert
23+
Midea IR Climate, components/climate/climate_ir, air-conditioner-ir.svg, dark-invert
2424
Safe Mode Button, components/button/safe_mode, restart-alert.svg, dark-invert
2525
Shutdown Button, components/button/shutdown, power_settings.svg, dark-invert
2626
Tuya Number, components/number/tuya, tuya.png

changelog/2023.12.0.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ ESPHome 2023.12.0 - 20th December 2023
1717
Graphical Display Menu, components/display_menu/graphical_display_menu, graphical_display_menu.png
1818
FT63X6, components/touchscreen/ft63x6, wt32-sc01.png
1919
A02YYUW, components/sensor/a02yyuw, a02yyuw.jpg
20-
PN7150, components/binary_sensor/pn7150, pn7150.jpg
21-
PN716X, components/binary_sensor/pn7160, pn716x.jpg
20+
PN7150, components/pn7150, pn7150.jpg
21+
PN716X, components/pn7160, pn716x.jpg
2222

2323
Graphical Menu
2424
--------------

0 commit comments

Comments
 (0)