From d8ffb732b7217685fee617adabe23dd5518a7507 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Jun 2026 15:04:22 -0500 Subject: [PATCH 01/26] Bump zeroconf from 0.149.16 to 0.150.0 (#17137) Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index a825cd9bff..2510ca61e9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -13,7 +13,7 @@ esptool==5.3.0 click==8.3.3 esphome-dashboard==20260425.0 aioesphomeapi==45.3.1 -zeroconf==0.149.16 +zeroconf==0.150.0 puremagic==1.30 ruamel.yaml==0.19.1 # dashboard_import ruamel.yaml.clib==0.2.15 # dashboard_import From bf0d31b3abdda74f79761a7af35c6d6a4a7e27a9 Mon Sep 17 00:00:00 2001 From: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com> Date: Mon, 22 Jun 2026 18:41:21 -0400 Subject: [PATCH 02/26] [espidf] Don't fail framework check on broken unrelated PATH tools (#17053) --- esphome/espidf/framework.py | 16 +++++++++------- tests/unit_tests/test_espidf_framework.py | 16 ++++++++++++---- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/esphome/espidf/framework.py b/esphome/espidf/framework.py index 6f4aeef9f0..4053898a8e 100644 --- a/esphome/espidf/framework.py +++ b/esphome/espidf/framework.py @@ -609,14 +609,16 @@ def _check_esphome_idf_framework_install( install = True if _check_stamp(env_stamp_file, stamp_info): _LOGGER.info("Checking ESP-IDF %s framework installation ...", version) - cmd = [ - get_system_python_path(), - str(idf_tools_path), - "--non-interactive", - "check", - ] - if run_command_ok(cmd, msg=f"ESP-IDF {version} check", env=env): + # Validate via the managed tool-path resolution, not ``idf_tools.py check``: + # ``check`` probes tools on the system PATH and aborts if any fail to run (e.g. a + # broken Homebrew openocd), which forced a toolchain reinstall on every build. + try: + _get_idf_tool_paths(framework_path, env) install = False + except RuntimeError as err: + _LOGGER.debug( + "ESP-IDF %s tool resolution failed, reinstalling: %s", version, err + ) # 4. Install framework tools if not installed or needs update if install: diff --git a/tests/unit_tests/test_espidf_framework.py b/tests/unit_tests/test_espidf_framework.py index d89b93f478..525cd55146 100644 --- a/tests/unit_tests/test_espidf_framework.py +++ b/tests/unit_tests/test_espidf_framework.py @@ -298,6 +298,9 @@ def espidf_mocks(setup_core: Path): patch("esphome.espidf.framework.archive_extract_all") as extract, patch("esphome.espidf.framework.create_venv") as venv, patch("esphome.espidf.framework.run_command_ok", return_value=True) as run_ok, + patch( + "esphome.espidf.framework._get_idf_tool_paths", return_value=([], {}) + ) as tool_paths, patch("esphome.espidf.framework._clone_idf_with_submodules") as clone, patch("esphome.espidf.framework._write_idf_version_txt"), patch("esphome.espidf.framework._patch_tools_json_for_linux_arm64"), @@ -308,7 +311,12 @@ def espidf_mocks(setup_core: Path): patch("esphome.espidf.framework.get_system_python_path", return_value="python"), ): yield SimpleNamespace( - download=download, extract=extract, venv=venv, run_ok=run_ok, clone=clone + download=download, + extract=extract, + venv=venv, + run_ok=run_ok, + tool_paths=tool_paths, + clone=clone, ) @@ -403,10 +411,10 @@ def test_check_esp_idf_install_stamp_mismatch_reinstalls( def test_check_esp_idf_install_check_command_failure_reinstalls( espidf_mocks: SimpleNamespace, ) -> None: - """A failing idf_tools check reinstalls tools (marker present, no re-extract).""" + """A failing tool-path resolution reinstalls tools (marker present, no re-extract).""" _mark_installed() - # idf_tools check fails -> install stays True; the later installs succeed. - espidf_mocks.run_ok.side_effect = [False, True, True, True] + # Managed tool resolution fails -> install stays True; the later installs succeed. + espidf_mocks.tool_paths.side_effect = RuntimeError("missing ESP-IDF tool") check_esp_idf_install(_IDF_VERSION, features=["fb"]) espidf_mocks.extract.assert_not_called() From 6d559a32df2fe427355a7c9f5cdb8c1e4e7a047e Mon Sep 17 00:00:00 2001 From: "esphome[bot]" <115708604+esphome[bot]@users.noreply.github.com> Date: Mon, 22 Jun 2026 17:45:22 -0500 Subject: [PATCH 03/26] Bump bundled esphome-device-builder to 1.0.14 (#17139) --- docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 1d39644ab8..bf37d6d88b 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -32,7 +32,7 @@ RUN \ -r /requirements.txt # Install the ESPHome Device Builder dashboard. -RUN uv pip install --no-cache-dir esphome-device-builder==1.0.12 +RUN uv pip install --no-cache-dir esphome-device-builder==1.0.14 RUN \ platformio settings set enable_telemetry No \ From 8d36167e114eb3bca37d88388eb8dde1b426bde4 Mon Sep 17 00:00:00 2001 From: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com> Date: Tue, 23 Jun 2026 15:21:26 -0400 Subject: [PATCH 04/26] [esp32_ble_server] Fix set_value action with by-reference triggers (#17156) --- .../esp32_ble_server/ble_server_automations.h | 6 ++-- tests/components/esp32_ble_server/common.yaml | 31 +++++++++++++++++++ 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/esphome/components/esp32_ble_server/ble_server_automations.h b/esphome/components/esp32_ble_server/ble_server_automations.h index b4e9ed004e..b1f887e2fa 100644 --- a/esphome/components/esp32_ble_server/ble_server_automations.h +++ b/esphome/components/esp32_ble_server/ble_server_automations.h @@ -77,13 +77,15 @@ template class BLECharacteristicSetValueAction : public Actionparent_->set_value(this->buffer_.value(x...)); // Set the listener for read events - this->parent_->on_read([this, x...](uint16_t id) { + // ``mutable`` keeps by-copy captures non-const for triggers passing args by reference + // (e.g. climate on_control's ClimateCall&). See #17142. + this->parent_->on_read([this, x...](uint16_t id) mutable { // Set the value of the characteristic every time it is read this->parent_->set_value(this->buffer_.value(x...)); }); // Set the listener in the global manager so only one BLECharacteristicSetValueAction is set for each characteristic BLECharacteristicSetValueActionManager::get_instance()->set_listener( - this->parent_, [this, x...]() { this->parent_->set_value(this->buffer_.value(x...)); }); + this->parent_, [this, x...]() mutable { this->parent_->set_value(this->buffer_.value(x...)); }); } protected: diff --git a/tests/components/esp32_ble_server/common.yaml b/tests/components/esp32_ble_server/common.yaml index 4e34049038..c617a73f87 100644 --- a/tests/components/esp32_ble_server/common.yaml +++ b/tests/components/esp32_ble_server/common.yaml @@ -77,3 +77,34 @@ esp32_ble_server: id: test_change_descriptor value: data: [0x01, 0x02, 0x03] + +# Regression test for #17142: the set_value action used from a trigger that passes +# its argument by reference (climate on_control supplies ClimateCall&) previously +# failed to compile. +sensor: + - platform: template + id: ble_test_temp + lambda: "return 20.0;" + +output: + - platform: template + id: ble_test_output + type: float + write_action: + - logger.log: "out" + +climate: + - platform: pid + name: "BLE Test Climate" + id: ble_test_climate + sensor: ble_test_temp + default_target_temperature: 20 + heat_output: ble_test_output + control_parameters: + kp: 0.1 + ki: 0.001 + kd: 0.1 + on_control: + - ble_server.characteristic.set_value: + id: test_notify_characteristic + value: !lambda "return std::vector{0, 1, 2};" From ee118d384a9aac9687fa6d79df3a92e08813f3e6 Mon Sep 17 00:00:00 2001 From: mnewton25 <83018731+mnewton25@users.noreply.github.com> Date: Tue, 23 Jun 2026 21:40:49 +0100 Subject: [PATCH 05/26] [esp32] Use POSIX path for secure-boot signing/verification keys Fixes #17164 (#17166) Co-authored-by: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com> --- esphome/components/esp32/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/esphome/components/esp32/__init__.py b/esphome/components/esp32/__init__.py index 5d4b3b8b47..9c68fec69b 100644 --- a/esphome/components/esp32/__init__.py +++ b/esphome/components/esp32/__init__.py @@ -2316,14 +2316,14 @@ async def to_code(config): add_idf_sdkconfig_option("CONFIG_SECURE_BOOT_BUILD_SIGNED_BINARIES", True) add_idf_sdkconfig_option( "CONFIG_SECURE_BOOT_SIGNING_KEY", - str(signed_ota[CONF_SIGNING_KEY].resolve()), + signed_ota[CONF_SIGNING_KEY].resolve().as_posix(), ) else: # Public key mode — verification only, external signing required add_idf_sdkconfig_option("CONFIG_SECURE_BOOT_BUILD_SIGNED_BINARIES", False) add_idf_sdkconfig_option( "CONFIG_SECURE_BOOT_VERIFICATION_KEY", - str(signed_ota[CONF_VERIFICATION_KEY].resolve()), + signed_ota[CONF_VERIFICATION_KEY].resolve().as_posix(), ) cg.add_define("USE_OTA_SIGNED_VERIFICATION") From b3dcaac2626f777b0fd07cafb46e9e748b1b97d5 Mon Sep 17 00:00:00 2001 From: Clyde Stubbs <2366188+clydebarrow@users.noreply.github.com> Date: Wed, 24 Jun 2026 08:43:39 +1000 Subject: [PATCH 06/26] [mipi_spi] Warn on MODE3 default for display without CS pin (#17153) --- esphome/components/mipi_spi/display.py | 10 ++++- tests/component_tests/mipi_spi/test_init.py | 44 +++++++++++++++++++++ 2 files changed, 52 insertions(+), 2 deletions(-) diff --git a/esphome/components/mipi_spi/display.py b/esphome/components/mipi_spi/display.py index abb7eaa458..d613d0a1ab 100644 --- a/esphome/components/mipi_spi/display.py +++ b/esphome/components/mipi_spi/display.py @@ -172,13 +172,19 @@ def model_schema(config): if bus_mode == TYPE_SINGLE: other_options.append(CONF_SPI_16) # Calculate default SPI mode. Mode3 for octal bus or single bus with no cs pin, mode0 otherwise. - spi_mode = model.get_default(CONF_SPI_MODE) + spi_mode = ( + cv.UNDEFINED if CONF_SPI_MODE in config else model.get_default(CONF_SPI_MODE) + ) if not spi_mode: if bus_mode == TYPE_OCTAL or ( bus_mode == TYPE_SINGLE - and not config.get(CONF_CS_PIN, model.get_default(CONF_CS_PIN)) + and config.get(CONF_CS_PIN, model.get_default(CONF_CS_PIN)) is False ): spi_mode = "MODE3" + if bus_mode == TYPE_SINGLE: + LOGGER.warning( + "No SPI mode specified, defaulting to MODE3 due to lack of CS pin. If you experience issues, try setting SPI mode explicitly to MODE0 or MODE3." + ) else: spi_mode = "MODE0" diff --git a/tests/component_tests/mipi_spi/test_init.py b/tests/component_tests/mipi_spi/test_init.py index d681908027..dbd8e15702 100644 --- a/tests/component_tests/mipi_spi/test_init.py +++ b/tests/component_tests/mipi_spi/test_init.py @@ -306,6 +306,50 @@ def test_all_predefined_models( run_schema_validation(config) +def test_single_bus_no_cs_no_mode_warns( + set_core_config: SetCoreConfigCallable, + caplog: pytest.LogCaptureFixture, +) -> None: + """A single-bus display with no CS pin and no explicit SPI mode warns about MODE3 default.""" + set_core_config( + PlatformFramework.ESP32_IDF, + platform_data={KEY_BOARD: "esp32dev", KEY_VARIANT: VARIANT_ESP32}, + ) + + run_schema_validation({"model": "ili9488", "dc_pin": 14}) + + assert "defaulting to MODE3 due to lack of CS pin" in caplog.text + + +@pytest.mark.parametrize( + "config", + [ + pytest.param( + {"model": "ili9488", "dc_pin": 14, "cs_pin": 0}, + id="cs_pin_provided", + ), + pytest.param( + {"model": "ili9488", "dc_pin": 14, "spi_mode": "mode0"}, + id="spi_mode_provided", + ), + ], +) +def test_single_bus_no_mode_warning_suppressed( + config: ConfigType, + set_core_config: SetCoreConfigCallable, + caplog: pytest.LogCaptureFixture, +) -> None: + """No MODE3 warning when a CS pin or an explicit SPI mode is provided.""" + set_core_config( + PlatformFramework.ESP32_IDF, + platform_data={KEY_BOARD: "esp32dev", KEY_VARIANT: VARIANT_ESP32}, + ) + + run_schema_validation(config) + + assert "defaulting to MODE3 due to lack of CS pin" not in caplog.text + + def test_native_generation( generate_main: Callable[[str | Path], str], component_fixture_path: Callable[[str], Path], From 4f7faa771274d3e274012ca5a17c4f45669a9209 Mon Sep 17 00:00:00 2001 From: "esphome[bot]" <115708604+esphome[bot]@users.noreply.github.com> Date: Wed, 24 Jun 2026 11:06:15 +1200 Subject: [PATCH 07/26] Bump bundled esphome-device-builder to 1.0.15 (#17170) --- docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index bf37d6d88b..9b2519b426 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -32,7 +32,7 @@ RUN \ -r /requirements.txt # Install the ESPHome Device Builder dashboard. -RUN uv pip install --no-cache-dir esphome-device-builder==1.0.14 +RUN uv pip install --no-cache-dir esphome-device-builder==1.0.15 RUN \ platformio settings set enable_telemetry No \ From 2ec24505d07361ab417fc8493651f5a041a77402 Mon Sep 17 00:00:00 2001 From: Clyde Stubbs <2366188+clydebarrow@users.noreply.github.com> Date: Wed, 24 Jun 2026 22:05:23 +1000 Subject: [PATCH 08/26] [mipi_spi] Suppress sequence errors when page selection used (#17176) --- esphome/components/mipi/__init__.py | 1 + esphome/components/mipi_spi/display.py | 20 ++-- esphome/components/mipi_spi/mipi_spi.h | 8 -- .../mipi_spi/test_page_selection.py | 113 ++++++++++++++++++ 4 files changed, 126 insertions(+), 16 deletions(-) create mode 100644 tests/component_tests/mipi_spi/test_page_selection.py diff --git a/esphome/components/mipi/__init__.py b/esphome/components/mipi/__init__.py index 129befe600..3c59345162 100644 --- a/esphome/components/mipi/__init__.py +++ b/esphome/components/mipi/__init__.py @@ -120,6 +120,7 @@ CSCON = 0xF0 PWCTR6 = 0xF6 ADJCTL3 = 0xF7 PAGESEL = 0xFE +PAGESEL1 = 0xFF MADCTL_MY = 0x80 # Bit 7 Bottom to top MADCTL_MX = 0x40 # Bit 6 Right to left diff --git a/esphome/components/mipi_spi/display.py b/esphome/components/mipi_spi/display.py index d613d0a1ab..0231d12529 100644 --- a/esphome/components/mipi_spi/display.py +++ b/esphome/components/mipi_spi/display.py @@ -17,6 +17,8 @@ from esphome.components.mipi import ( MADCTL, MODE_BGR, MODE_RGB, + PAGESEL, + PAGESEL1, PIXFMT, DriverChip, dimension_schema, @@ -276,14 +278,16 @@ def customise_schema(config): # Check for invalid combinations of MADCTL config if init_sequence := config.get(CONF_INIT_SEQUENCE): commands = [x[0] for x in init_sequence] - if MADCTL in commands and CONF_TRANSFORM in config: - raise cv.Invalid( - f"transform is not supported when MADCTL ({MADCTL:#X}) is in the init sequence" - ) - if PIXFMT in commands: - raise cv.Invalid( - f"PIXFMT ({PIXFMT:#X}) should not be in the init sequence, it will be set automatically" - ) + # If there is page swapping, we can't rely on recognising common commands + if PAGESEL not in commands and PAGESEL1 not in commands: + if MADCTL in commands and CONF_TRANSFORM in config: + raise cv.Invalid( + f"transform is not supported when MADCTL ({MADCTL:#X}) is in the init sequence" + ) + if PIXFMT in commands: + raise cv.Invalid( + f"PIXFMT ({PIXFMT:#X}) should not be in the init sequence, it will be set automatically" + ) if bus_mode == TYPE_QUAD and CONF_DC_PIN in config: raise cv.Invalid("DC pin is not supported in quad mode") diff --git a/esphome/components/mipi_spi/mipi_spi.h b/esphome/components/mipi_spi/mipi_spi.h index a594e48209..d9627899e0 100644 --- a/esphome/components/mipi_spi/mipi_spi.h +++ b/esphome/components/mipi_spi/mipi_spi.h @@ -176,7 +176,6 @@ class MipiSpi : public display::Display, this->mark_failed(); return; } - auto arg_byte = vec[index]; switch (cmd) { case SLEEP_OUT: { // are we ready, boots? @@ -187,13 +186,6 @@ class MipiSpi : public display::Display, } } break; - case INVERT_ON: - this->invert_colors_ = true; - break; - case BRIGHTNESS: - this->brightness_ = arg_byte; - break; - default: break; } diff --git a/tests/component_tests/mipi_spi/test_page_selection.py b/tests/component_tests/mipi_spi/test_page_selection.py new file mode 100644 index 0000000000..4b1ec22271 --- /dev/null +++ b/tests/component_tests/mipi_spi/test_page_selection.py @@ -0,0 +1,113 @@ +"""Combined tests for PAGESEL/PAGESEL1 behaviour with MADCTL/PIXFMT. + +Covers both the suppression behaviour (when PAGESEL or PAGESEL1 are present) +and the error behaviour when neither page-selection command is present. +""" + +from __future__ import annotations + +from typing import Any + +import pytest + +from esphome.components.esp32 import KEY_BOARD, KEY_VARIANT, VARIANT_ESP32 +from esphome.components.mipi import MADCTL, PAGESEL, PAGESEL1, PIXFMT +from esphome.components.mipi_spi.display import CONFIG_SCHEMA, FINAL_VALIDATE_SCHEMA +import esphome.config_validation as cv +from esphome.const import PlatformFramework +from tests.component_tests.types import SetCoreConfigCallable + + +def validated_config(config: dict[str, Any]) -> dict[str, Any]: + """Run schema + final validation and return the validated config.""" + cfg = CONFIG_SCHEMA(config) + FINAL_VALIDATE_SCHEMA(cfg) + return cfg + + +def test_madctl_error_suppressed_when_pagesel_present( + set_core_config: SetCoreConfigCallable, +) -> None: + """If PAGESEL is present in init_sequence, MADCTL presence must not raise an error.""" + set_core_config( + PlatformFramework.ESP32_IDF, + platform_data={KEY_BOARD: "esp32dev", KEY_VARIANT: VARIANT_ESP32}, + ) + + cfg = { + "model": "custom", + "dc_pin": 18, + "dimensions": {"width": 320, "height": 240}, + "transform": {"mirror_x": True, "mirror_y": True, "swap_xy": False}, + "init_sequence": [[PAGESEL, 0x00], [MADCTL, 0x01]], + } + + # Should not raise + validated = validated_config(cfg) + assert validated is not None + + +def test_pixfmt_error_suppressed_when_pagesel1_present( + set_core_config: SetCoreConfigCallable, +) -> None: + """If PAGESEL1 is present in init_sequence, PIXFMT presence must not raise an error.""" + set_core_config( + PlatformFramework.ESP32_IDF, + platform_data={KEY_BOARD: "esp32dev", KEY_VARIANT: VARIANT_ESP32}, + ) + + cfg = { + "model": "custom", + "dc_pin": 18, + "dimensions": {"width": 320, "height": 240}, + "init_sequence": [[PAGESEL1, 0x00], [PIXFMT, 0x01]], + } + + # Should not raise + validated = validated_config(cfg) + assert validated is not None + + +def test_madctl_raises_without_pagesel( + set_core_config: SetCoreConfigCallable, +) -> None: + """MADCTL in the init_sequence should raise when a transform is configured and + no PAGESEL/PAGESEL1 is present. + """ + set_core_config( + PlatformFramework.ESP32_IDF, + platform_data={KEY_BOARD: "esp32dev", KEY_VARIANT: VARIANT_ESP32}, + ) + + cfg: dict[str, Any] = { + "model": "custom", + "dc_pin": 18, + "dimensions": {"width": 320, "height": 240}, + "transform": {"mirror_x": True, "mirror_y": True, "swap_xy": False}, + "init_sequence": [[MADCTL, 0x01]], + } + + with pytest.raises(cv.Invalid, match=r"MADCTL .* in the init sequence"): + CONFIG_SCHEMA(cfg) + + +def test_pixfmt_raises_without_pagesel1( + set_core_config: SetCoreConfigCallable, +) -> None: + """PIXFMT in the init_sequence should raise when no PAGESEL/PAGESEL1 is present.""" + set_core_config( + PlatformFramework.ESP32_IDF, + platform_data={KEY_BOARD: "esp32dev", KEY_VARIANT: VARIANT_ESP32}, + ) + + cfg: dict[str, Any] = { + "model": "custom", + "dc_pin": 18, + "dimensions": {"width": 320, "height": 240}, + "init_sequence": [[PIXFMT, 0x01]], + } + + with pytest.raises( + cv.Invalid, match=r"PIXFMT .* should not be in the init sequence" + ): + CONFIG_SCHEMA(cfg) From 94ccddf176b4fd6521358bba3cba33c9fa6daa7f Mon Sep 17 00:00:00 2001 From: Geoffrey Frogeye Date: Wed, 24 Jun 2026 15:29:57 +0200 Subject: [PATCH 09/26] [opentherm] Support power scaling disabled (#17183) Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> --- .../components/opentherm/output/opentherm_output.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/esphome/components/opentherm/output/opentherm_output.cpp b/esphome/components/opentherm/output/opentherm_output.cpp index 2735c85d06..4092358d75 100644 --- a/esphome/components/opentherm/output/opentherm_output.cpp +++ b/esphome/components/opentherm/output/opentherm_output.cpp @@ -7,9 +7,13 @@ static const char *const TAG = "opentherm.output"; void opentherm::OpenthermOutput::write_state(float state) { ESP_LOGD(TAG, "Received state: %.2f. Min value: %.2f, max value: %.2f", state, min_value_, max_value_); - this->state = state < 0.003 && this->zero_means_zero_ - ? 0.0 - : clamp(std::lerp(min_value_, max_value_, state), min_value_, max_value_); +#ifdef USE_OUTPUT_FLOAT_POWER_SCALING + bool zero_means_zero = this->zero_means_zero_; +#else + bool zero_means_zero = false; +#endif + this->state = + state < 0.003 && zero_means_zero ? 0.0 : clamp(std::lerp(min_value_, max_value_, state), min_value_, max_value_); this->has_state_ = true; ESP_LOGD(TAG, "Output %s set to %.2f", this->id_, this->state); } From 26cf373ae72f0a1f07563483ec2fcd1dc071013c Mon Sep 17 00:00:00 2001 From: "esphome[bot]" <115708604+esphome[bot]@users.noreply.github.com> Date: Wed, 24 Jun 2026 17:15:00 +0200 Subject: [PATCH 10/26] Bump bundled esphome-device-builder to 1.0.16 (#17182) --- docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 9b2519b426..5b9c7b8b55 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -32,7 +32,7 @@ RUN \ -r /requirements.txt # Install the ESPHome Device Builder dashboard. -RUN uv pip install --no-cache-dir esphome-device-builder==1.0.15 +RUN uv pip install --no-cache-dir esphome-device-builder==1.0.16 RUN \ platformio settings set enable_telemetry No \ From dfe14f9c3ae0750beba518f1d2e3ecc27e75d45d Mon Sep 17 00:00:00 2001 From: "esphome[bot]" <115708604+esphome[bot]@users.noreply.github.com> Date: Thu, 25 Jun 2026 02:04:22 +0200 Subject: [PATCH 11/26] Bump bundled esphome-device-builder to 1.0.17 (#17199) --- docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 5b9c7b8b55..c0795de60f 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -32,7 +32,7 @@ RUN \ -r /requirements.txt # Install the ESPHome Device Builder dashboard. -RUN uv pip install --no-cache-dir esphome-device-builder==1.0.16 +RUN uv pip install --no-cache-dir esphome-device-builder==1.0.17 RUN \ platformio settings set enable_telemetry No \ From 7a64163c4fec2fd221aa7fb241284b9f1e16c150 Mon Sep 17 00:00:00 2001 From: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com> Date: Wed, 24 Jun 2026 20:40:28 -0400 Subject: [PATCH 12/26] [esp32] Accept '#' as ESP-IDF source ref separator (#17193) --- esphome/espidf/framework.py | 9 ++++++--- tests/unit_tests/test_espidf_framework.py | 13 +++++++++++++ 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/esphome/espidf/framework.py b/esphome/espidf/framework.py index 4053898a8e..7213f2dfc0 100644 --- a/esphome/espidf/framework.py +++ b/esphome/espidf/framework.py @@ -337,16 +337,19 @@ print(".".join([str(x) for x in sys.version_info])) _GITHUB_SHORTHAND_RE = re.compile( - r"^github://([a-zA-Z0-9\-]+)/([a-zA-Z0-9\-\._]+?)(?:@([a-zA-Z0-9\-_.\./]+))?$" + r"^github://([a-zA-Z0-9\-]+)/([a-zA-Z0-9\-\._]+?)(?:[@#]([a-zA-Z0-9\-_.\./]+))?$" ) _GITHUB_HTTPS_RE = re.compile( - r"^(https://github\.com/[a-zA-Z0-9\-]+/[a-zA-Z0-9\-\._]+?\.git)(?:@([a-zA-Z0-9\-_.\./]+))?$" + r"^(https://github\.com/[a-zA-Z0-9\-]+/[a-zA-Z0-9\-\._]+?\.git)(?:[@#]([a-zA-Z0-9\-_.\./]+))?$" ) def _parse_git_source(source_url: str) -> tuple[str, str | None] | None: """Return ``(url, ref)`` for ``github://owner/repo[@ref]`` or - ``https://github.com/owner/repo.git[@ref]``, else ``None``.""" + ``https://github.com/owner/repo.git[@ref]``, else ``None``. + + The ref may be separated with ``@`` or ``#``; ``#`` matches the PlatformIO + convention used for ``platform_version`` URLs.""" if m := _GITHUB_SHORTHAND_RE.match(source_url): owner, repo, ref = m.group(1), m.group(2), m.group(3) # Tolerate a trailing ".git" on the shorthand repo so the diff --git a/tests/unit_tests/test_espidf_framework.py b/tests/unit_tests/test_espidf_framework.py index 525cd55146..e0f63e89b4 100644 --- a/tests/unit_tests/test_espidf_framework.py +++ b/tests/unit_tests/test_espidf_framework.py @@ -64,6 +64,19 @@ from esphome.framework_helpers import _tar_extract_all, get_python_env_executabl "https://github.com/espressif/esp-idf.git@v6.0.1", ("https://github.com/espressif/esp-idf.git", "v6.0.1"), ), + # '#' ref separator (PlatformIO/git-web convention) works on both forms + ( + "https://github.com/espressif/esp-idf.git#release/v6.1", + ("https://github.com/espressif/esp-idf.git", "release/v6.1"), + ), + ( + "github://espressif/esp-idf#release/v6.1", + ("https://github.com/espressif/esp-idf.git", "release/v6.1"), + ), + ( + "github://espressif/esp-idf.git#master", + ("https://github.com/espressif/esp-idf.git", "master"), + ), # Tolerate a trailing ".git" on the shorthand so the user doesn't # silently end up with a doubled "...esp-idf.git.git" URL. ( From 8bc5b97298be6f25f411c267c450e670861aeb82 Mon Sep 17 00:00:00 2001 From: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com> Date: Wed, 24 Jun 2026 22:28:06 -0400 Subject: [PATCH 13/26] [network] Set IPv4 type tag on all lwIP platforms, not just esp32 (#17200) --- esphome/components/network/ip_address.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esphome/components/network/ip_address.h b/esphome/components/network/ip_address.h index 55bb2a1c89..d8a127f4a0 100644 --- a/esphome/components/network/ip_address.h +++ b/esphome/components/network/ip_address.h @@ -119,7 +119,7 @@ struct IPAddress { IPAddress(const std::string &in_address) { ipaddr_aton(in_address.c_str(), &ip_addr_); } IPAddress(ip4_addr_t *other_ip) { memcpy((void *) &ip_addr_, (void *) other_ip, sizeof(ip4_addr_t)); -#if USE_ESP32 && LWIP_IPV6 +#if LWIP_IPV6 ip_addr_.type = IPADDR_TYPE_V4; #endif } From 29dfd820c68b803a1255ef812533ac0485bbf481 Mon Sep 17 00:00:00 2001 From: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com> Date: Wed, 24 Jun 2026 22:28:15 -0400 Subject: [PATCH 14/26] [wifi] Report STA IP, not SoftAP IP, in wifi_info on ESP8266 (#17185) --- esphome/components/wifi/wifi_component_esp8266.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/esphome/components/wifi/wifi_component_esp8266.cpp b/esphome/components/wifi/wifi_component_esp8266.cpp index 717d542fbe..84b864c0c5 100644 --- a/esphome/components/wifi/wifi_component_esp8266.cpp +++ b/esphome/components/wifi/wifi_component_esp8266.cpp @@ -218,9 +218,18 @@ network::IPAddresses WiFiComponent::wifi_sta_ip_addresses() { return {}; network::IPAddresses addresses; uint8_t index = 0; + // addrList enumerates all lwIP netifs, including the SoftAP / fallback hotspot. Filter out + // the AP address so the STA address is reported as the device IP (see issue #17181). + struct ip_info ap_ip {}; + wifi_get_ip_info(SOFTAP_IF, &ap_ip); + network::IPAddress ap_address(&ap_ip.ip); + bool filter_ap = ap_address.is_set(); for (auto &addr : addrList) { + network::IPAddress ip(addr.ipFromNetifNum()); + if (filter_ap && ip == ap_address) + continue; assert(index < addresses.size()); - addresses[index++] = addr.ipFromNetifNum(); + addresses[index++] = ip; } return addresses; } From f3d61ca3e12703d076be6b71e0565edad7fe25a4 Mon Sep 17 00:00:00 2001 From: Clyde Stubbs <2366188+clydebarrow@users.noreply.github.com> Date: Thu, 25 Jun 2026 22:36:36 +1000 Subject: [PATCH 15/26] [mipi][mipi_spi] Swap native dimensions for swap_xy hardware transform (#17201) Co-authored-by: Claude Opus 4.8 --- esphome/components/mipi/__init__.py | 36 ++-- esphome/components/mipi_spi/display.py | 16 +- .../mipi_spi/test_padding_and_offsets.py | 167 +++++++++++++++++- 3 files changed, 191 insertions(+), 28 deletions(-) diff --git a/esphome/components/mipi/__init__.py b/esphome/components/mipi/__init__.py index 3c59345162..63c3ddf9c2 100644 --- a/esphome/components/mipi/__init__.py +++ b/esphome/components/mipi/__init__.py @@ -388,6 +388,16 @@ class DriverChip: return {CONF_MIRROR_X, CONF_MIRROR_Y, CONF_SWAP_XY} return {CONF_MIRROR_X, CONF_MIRROR_Y} + def has_hardware_transform(self, config) -> bool: + """ + Check if the model supports hardware transforms for the given configuration. + """ + return config.get(CONF_TRANSFORM) != CONF_DISABLED and self.transforms == { + CONF_MIRROR_X, + CONF_MIRROR_Y, + CONF_SWAP_XY, + } + def option(self, name, fallback=False) -> cv.Optional: return cv.Optional(name, default=self.get_default(name, fallback)) @@ -418,10 +428,15 @@ class DriverChip: :return: A tuple (width, height, offset_width, offset_height, pad_width, pad_height). """ + transform = self.get_transform(config) if CONF_DIMENSIONS in config: # Explicit dimensions, just use as is dimensions = config[CONF_DIMENSIONS] if isinstance(dimensions, dict): + native_width = self.get_default(CONF_NATIVE_WIDTH, 0) + native_height = self.get_default(CONF_NATIVE_HEIGHT, 0) + if transform.get(CONF_SWAP_XY) is True: + native_width, native_height = native_height, native_width width = dimensions[CONF_WIDTH] height = dimensions[CONF_HEIGHT] offset_width = dimensions[CONF_OFFSET_WIDTH] @@ -429,23 +444,19 @@ class DriverChip: if CONF_PAD_WIDTH in dimensions: pad_width = dimensions[CONF_PAD_WIDTH] native_width = width + offset_width + pad_width + elif native_width == 0: + pad_width = 0 + native_width = width + offset_width else: - native_width = self.get_default(CONF_NATIVE_WIDTH, 0) - if native_width == 0: - pad_width = 0 - native_width = width + offset_width - else: - pad_width = native_width - width - offset_width + pad_width = native_width - width - offset_width if CONF_PAD_HEIGHT in dimensions: pad_height = dimensions[CONF_PAD_HEIGHT] native_height = height + offset_height + pad_height + elif native_height == 0: + pad_height = 0 + native_height = height + offset_height else: - native_height = self.get_default(CONF_NATIVE_HEIGHT, 0) - if native_height == 0: - pad_height = 0 - native_height = height + offset_height - else: - pad_height = native_height - height - offset_height + pad_height = native_height - height - offset_height if ( pad_width + offset_width >= native_width or pad_height + offset_height >= native_height @@ -461,7 +472,6 @@ class DriverChip: return width, height, 0, 0, 0, 0 # Default dimensions, use model defaults - transform = self.get_transform(config) width = self.get_default(CONF_WIDTH) height = self.get_default(CONF_HEIGHT) diff --git a/esphome/components/mipi_spi/display.py b/esphome/components/mipi_spi/display.py index 0231d12529..4162459058 100644 --- a/esphome/components/mipi_spi/display.py +++ b/esphome/components/mipi_spi/display.py @@ -295,13 +295,7 @@ def customise_schema(config): raise cv.Invalid(f"DC pin is required in {bus_mode} mode") denominator(config) model = MODELS[config[CONF_MODEL]] - has_hardware_transform = config.get( - CONF_TRANSFORM - ) != CONF_DISABLED and model.transforms == { - CONF_MIRROR_X, - CONF_MIRROR_Y, - CONF_SWAP_XY, - } + has_hardware_transform = model.has_hardware_transform(config) width, height, _offset_width, _offset_height, _pad_width, _pad_height = ( model.get_dimensions(config, not has_hardware_transform) ) @@ -366,13 +360,7 @@ def get_instance(config): :return: type, template arguments """ model = MODELS[config[CONF_MODEL]] - has_hardware_transform = config.get( - CONF_TRANSFORM - ) != CONF_DISABLED and model.transforms == { - CONF_MIRROR_X, - CONF_MIRROR_Y, - CONF_SWAP_XY, - } + has_hardware_transform = model.has_hardware_transform(config) width, height, offset_width, offset_height, pad_width, pad_height = ( model.get_dimensions(config, not has_hardware_transform) ) diff --git a/tests/component_tests/mipi_spi/test_padding_and_offsets.py b/tests/component_tests/mipi_spi/test_padding_and_offsets.py index 82adf88b7e..7ae6f0e61f 100644 --- a/tests/component_tests/mipi_spi/test_padding_and_offsets.py +++ b/tests/component_tests/mipi_spi/test_padding_and_offsets.py @@ -13,6 +13,16 @@ from esphome.components.esp32 import ( VARIANT_ESP32, VARIANT_ESP32S3, ) +from esphome.components.mipi import ( + CONF_DIMENSIONS, + CONF_HEIGHT, + CONF_MIRROR_X, + CONF_MIRROR_Y, + CONF_OFFSET_HEIGHT, + CONF_OFFSET_WIDTH, + CONF_SWAP_XY, + CONF_WIDTH, +) from esphome.components.mipi_spi.display import ( CONFIG_SCHEMA, FINAL_VALIDATE_SCHEMA, @@ -20,7 +30,13 @@ from esphome.components.mipi_spi.display import ( get_instance, ) from esphome.components.spi import CONF_SPI_MODE, TYPE_OCTAL, TYPE_QUAD, TYPE_SINGLE -from esphome.const import CONF_CS_PIN, CONF_DC_PIN, PlatformFramework +from esphome.const import ( + CONF_CS_PIN, + CONF_DC_PIN, + CONF_DISABLED, + CONF_TRANSFORM, + PlatformFramework, +) from esphome.types import ConfigType from tests.component_tests.types import SetCoreConfigCallable @@ -432,3 +448,152 @@ class TestUserConfiguredPadding: assert config["dimensions"]["width"] == 240 assert config["dimensions"]["height"] == 240 assert config["dimensions"]["pad_height"] == 16 + + +class TestHasHardwareTransform: + """Test DriverChip.has_hardware_transform().""" + + def test_full_transform_model_without_transform_key(self) -> None: + """A model supporting swap_xy uses a hardware transform by default.""" + model = MODELS["ST7789V"] + assert model.has_hardware_transform({}) is True + + def test_full_transform_model_with_transform_dict(self) -> None: + """A configured (non-disabled) transform still uses the hardware path.""" + model = MODELS["ST7789V"] + assert ( + model.has_hardware_transform({CONF_TRANSFORM: {CONF_SWAP_XY: True}}) is True + ) + + def test_full_transform_model_with_transform_disabled(self) -> None: + """Disabling the transform falls back to software transforms.""" + model = MODELS["ST7789V"] + assert model.has_hardware_transform({CONF_TRANSFORM: CONF_DISABLED}) is False + + def test_model_without_swap_xy_support(self) -> None: + """Models that cannot swap axes never use a hardware transform.""" + # AXS15231 only supports mirror_x/mirror_y, not swap_xy. + model = MODELS["AXS15231"] + assert model.transforms == {CONF_MIRROR_X, CONF_MIRROR_Y} + assert model.has_hardware_transform({}) is False + + +class TestSwapXYNativeDimensions: + """Test that native dimensions are swapped when a swap_xy transform is active. + + When explicit dimensions are given in the swapped (rotated) orientation and the + model applies a hardware swap_xy transform, the model's native_width/native_height + defaults must be swapped to match, otherwise padding is computed against the wrong + axis and validation fails. + """ + + def test_explicit_swapped_dimensions_with_swap_xy_transform( + self, + set_core_config: SetCoreConfigCallable, + ) -> None: + """Explicit landscape dimensions on a portrait-native model with swap_xy.""" + set_core_config( + PlatformFramework.ESP32_IDF, + platform_data={KEY_BOARD: "esp32dev", KEY_VARIANT: VARIANT_ESP32}, + ) + + # ST7789V is natively 240x320 (portrait). Provide landscape dimensions + # together with a swap_xy transform. + model = MODELS["ST7789V"] + assert model.get_default("native_width") == 240 + assert model.get_default("native_height") == 320 + + config = { + "model": "ST7789V", + CONF_DIMENSIONS: { + CONF_WIDTH: 320, + CONF_HEIGHT: 240, + CONF_OFFSET_WIDTH: 0, + CONF_OFFSET_HEIGHT: 0, + }, + CONF_TRANSFORM: { + CONF_SWAP_XY: True, + CONF_MIRROR_X: False, + CONF_MIRROR_Y: False, + }, + } + + # swap=False because the buffer is laid out in the requested orientation. + width, height, offset_w, offset_h, pad_w, pad_h = model.get_dimensions( + config, swap=False + ) + # Native dims are swapped to 320x240, so padding works out to zero rather + # than going negative (which previously raised "Invalid offsets"). + assert (width, height) == (320, 240) + assert (offset_w, offset_h) == (0, 0) + assert (pad_w, pad_h) == (0, 0) + + def test_explicit_dimensions_without_swap_keeps_native_orientation( + self, + set_core_config: SetCoreConfigCallable, + ) -> None: + """Without swap_xy the native dimensions keep their original orientation.""" + set_core_config( + PlatformFramework.ESP32_IDF, + platform_data={KEY_BOARD: "esp32dev", KEY_VARIANT: VARIANT_ESP32}, + ) + + model = MODELS["ST7789V"] + config = { + "model": "ST7789V", + CONF_DIMENSIONS: { + CONF_WIDTH: 240, + CONF_HEIGHT: 320, + CONF_OFFSET_WIDTH: 0, + CONF_OFFSET_HEIGHT: 0, + }, + CONF_TRANSFORM: { + CONF_SWAP_XY: False, + CONF_MIRROR_X: False, + CONF_MIRROR_Y: False, + }, + } + + width, height, offset_w, offset_h, pad_w, pad_h = model.get_dimensions( + config, swap=False + ) + assert (width, height) == (240, 320) + assert (offset_w, offset_h) == (0, 0) + assert (pad_w, pad_h) == (0, 0) + + def test_swapped_native_dimensions_compute_padding( + self, + set_core_config: SetCoreConfigCallable, + ) -> None: + """Padding is derived from the swapped native size when swap_xy is active.""" + set_core_config( + PlatformFramework.ESP32_IDF, + platform_data={KEY_BOARD: "esp32dev", KEY_VARIANT: VARIANT_ESP32}, + ) + + # ILI9341 is natively 240x320. Request a 300x240 area in landscape; the + # swapped native size is 320x240, leaving 20px of horizontal padding. + model = MODELS["ILI9341"] + assert model.get_default("native_width") == 240 + assert model.get_default("native_height") == 320 + + config = { + "model": "ILI9341", + CONF_DIMENSIONS: { + CONF_WIDTH: 300, + CONF_HEIGHT: 240, + CONF_OFFSET_WIDTH: 0, + CONF_OFFSET_HEIGHT: 0, + }, + CONF_TRANSFORM: { + CONF_SWAP_XY: True, + CONF_MIRROR_X: False, + CONF_MIRROR_Y: False, + }, + } + + width, height, _, _, pad_w, pad_h = model.get_dimensions(config, swap=False) + assert (width, height) == (300, 240) + # native_width swapped to 320 -> pad_width = 320 - 300 - 0 = 20 + assert pad_w == 20 + assert pad_h == 0 From 9a1daa5247372902d15413eff0b8d0d9e0804670 Mon Sep 17 00:00:00 2001 From: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com> Date: Thu, 25 Jun 2026 12:36:10 -0400 Subject: [PATCH 16/26] [hbridge] Fix light stuck on one polarity (#17162) --- esphome/components/hbridge/light/__init__.py | 6 ++-- .../hbridge/light/hbridge_light_output.h | 30 +++++++++++-------- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/esphome/components/hbridge/light/__init__.py b/esphome/components/hbridge/light/__init__.py index ccb47237b6..f9451e2594 100644 --- a/esphome/components/hbridge/light/__init__.py +++ b/esphome/components/hbridge/light/__init__.py @@ -1,14 +1,14 @@ import esphome.codegen as cg from esphome.components import light, output import esphome.config_validation as cv -from esphome.const import CONF_OUTPUT_ID, CONF_PIN_A, CONF_PIN_B +from esphome.const import CONF_OUTPUT_ID, CONF_PIN_A, CONF_PIN_B, CONF_UPDATE_INTERVAL from .. import hbridge_ns CODEOWNERS = ["@DotNetDann"] HBridgeLightOutput = hbridge_ns.class_( - "HBridgeLightOutput", cg.Component, light.LightOutput + "HBridgeLightOutput", cg.PollingComponent, light.LightOutput ) CONFIG_SCHEMA = light.RGB_LIGHT_SCHEMA.extend( @@ -16,12 +16,14 @@ CONFIG_SCHEMA = light.RGB_LIGHT_SCHEMA.extend( cv.GenerateID(CONF_OUTPUT_ID): cv.declare_id(HBridgeLightOutput), cv.Required(CONF_PIN_A): cv.use_id(output.FloatOutput), cv.Required(CONF_PIN_B): cv.use_id(output.FloatOutput), + cv.Optional(CONF_UPDATE_INTERVAL, default="8ms"): cv.update_interval, } ) async def to_code(config): var = cg.new_Pvariable(config[CONF_OUTPUT_ID]) + cg.add(var.set_update_interval(config.pop(CONF_UPDATE_INTERVAL))) await cg.register_component(var, config) await light.register_light(var, config) diff --git a/esphome/components/hbridge/light/hbridge_light_output.h b/esphome/components/hbridge/light/hbridge_light_output.h index 16408f24f1..9dcf7adfd8 100644 --- a/esphome/components/hbridge/light/hbridge_light_output.h +++ b/esphome/components/hbridge/light/hbridge_light_output.h @@ -3,11 +3,10 @@ #include "esphome/components/light/light_output.h" #include "esphome/components/output/float_output.h" #include "esphome/core/component.h" -#include "esphome/core/helpers.h" namespace esphome::hbridge { -class HBridgeLightOutput : public Component, public light::LightOutput { +class HBridgeLightOutput final : public PollingComponent, public light::LightOutput { public: void set_pina_pin(output::FloatOutput *pina_pin) { this->pina_pin_ = pina_pin; } void set_pinb_pin(output::FloatOutput *pinb_pin) { this->pinb_pin_ = pinb_pin; } @@ -20,11 +19,12 @@ class HBridgeLightOutput : public Component, public light::LightOutput { return traits; } - void setup() override { this->disable_loop(); } + void setup() override { this->stop_poller(); } - void loop() override { - // Only called when both channels are active — alternate H-bridge direction - // each iteration to multiplex cold and warm white. + void update() override { + // Flip the H-bridge direction to multiplex cold/warm white. update_interval must stay + // slower than the output's PWM period (flipping faster collapses the output onto one + // channel) but fast enough to avoid flicker (issue #17030). if (!this->forward_direction_) { this->pina_pin_->set_level(this->pina_duty_); this->pinb_pin_->set_level(0); @@ -46,13 +46,17 @@ class HBridgeLightOutput : public Component, public light::LightOutput { this->pinb_duty_ = new_pinb; if (new_pina != 0.0f && new_pinb != 0.0f) { - // Both channels active — need loop to alternate H-bridge direction - this->high_freq_.start(); - this->enable_loop(); + // Both channels active — multiplex the H-bridge direction via the poller. + if (!this->multiplexing_) { + this->multiplexing_ = true; + this->start_poller(); + } } else { - // Zero or one channel active — drive pins directly, no multiplexing needed - this->high_freq_.stop(); - this->disable_loop(); + // Zero or one channel active — drive pins directly, no multiplexing needed. + if (this->multiplexing_) { + this->multiplexing_ = false; + this->stop_poller(); + } this->pina_pin_->set_level(new_pina); this->pinb_pin_->set_level(new_pinb); } @@ -64,7 +68,7 @@ class HBridgeLightOutput : public Component, public light::LightOutput { float pina_duty_{0}; float pinb_duty_{0}; bool forward_direction_{false}; - HighFrequencyLoopRequester high_freq_; + bool multiplexing_{false}; }; } // namespace esphome::hbridge From eb711381d33749bb291170f333c88cb2750fb438 Mon Sep 17 00:00:00 2001 From: "esphome[bot]" <115708604+esphome[bot]@users.noreply.github.com> Date: Thu, 25 Jun 2026 19:47:24 +0200 Subject: [PATCH 17/26] Bump bundled esphome-device-builder to 1.0.18 (#17212) Co-authored-by: esphome[bot] <115708604+esphome[bot]@users.noreply.github.com> --- docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index c0795de60f..24710365cf 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -32,7 +32,7 @@ RUN \ -r /requirements.txt # Install the ESPHome Device Builder dashboard. -RUN uv pip install --no-cache-dir esphome-device-builder==1.0.17 +RUN uv pip install --no-cache-dir esphome-device-builder==1.0.18 RUN \ platformio settings set enable_telemetry No \ From f78cbf920033cb72ce965ad14d69bb71c53f0510 Mon Sep 17 00:00:00 2001 From: "esphome[bot]" <115708604+esphome[bot]@users.noreply.github.com> Date: Fri, 26 Jun 2026 07:48:52 +0200 Subject: [PATCH 18/26] Bump bundled esphome-device-builder to 1.0.19 (#17217) Co-authored-by: esphome[bot] <115708604+esphome[bot]@users.noreply.github.com> --- docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 24710365cf..4a375ed15b 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -32,7 +32,7 @@ RUN \ -r /requirements.txt # Install the ESPHome Device Builder dashboard. -RUN uv pip install --no-cache-dir esphome-device-builder==1.0.18 +RUN uv pip install --no-cache-dir esphome-device-builder==1.0.19 RUN \ platformio settings set enable_telemetry No \ From 84d1c34c28cb6d45545c0803659f124ac23b8242 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Sat, 27 Jun 2026 15:49:56 +0200 Subject: [PATCH 19/26] [core] Fix area saved as null in storage.json (#17219) Co-authored-by: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com> --- esphome/core/config.py | 12 +++++++++++- tests/unit_tests/core/test_config.py | 29 +++++++++++++++++++++++++--- 2 files changed, 37 insertions(+), 4 deletions(-) diff --git a/esphome/core/config.py b/esphome/core/config.py index b925f0b7d9..59c96035b8 100644 --- a/esphome/core/config.py +++ b/esphome/core/config.py @@ -407,6 +407,17 @@ def preload_core_config(config, result) -> str: CORE.name = conf[CONF_NAME] CORE.friendly_name = conf.get(CONF_FRIENDLY_NAME) + # Record the node's area name now (substitutions are already resolved at this + # point). storage.json is written before to_code() runs, so deferring this to + # to_code() left the area as null in storage.json. The value here is the raw + # post-substitution form (a plain string or a {name: ...} mapping). Assign + # unconditionally (like friendly_name) so a config without an area never + # inherits a stale value from a previous load in a long-running process, and + # use .get() so a malformed mapping surfaces later as a proper validation + # error rather than a KeyError here. to_code() sets it again from the + # validated config, which yields the same name. + area = conf.get(CONF_AREA) + CORE.area = area.get(CONF_NAME) if isinstance(area, dict) else area CORE.data[KEY_CORE] = {} if CONF_BUILD_PATH not in conf: @@ -760,7 +771,6 @@ async def to_code(config: ConfigType) -> None: # Process areas all_areas: list[dict[str, str | core.ID]] = [] if CONF_AREA in config: - CORE.area = config[CONF_AREA][CONF_NAME] all_areas.append(config[CONF_AREA]) all_areas.extend(config[CONF_AREAS]) diff --git a/tests/unit_tests/core/test_config.py b/tests/unit_tests/core/test_config.py index e2b34d92d8..b3d87f6857 100644 --- a/tests/unit_tests/core/test_config.py +++ b/tests/unit_tests/core/test_config.py @@ -152,15 +152,21 @@ def test_multiple_areas_and_devices(yaml_file: Callable[[str], str]) -> None: ("multiple_areas_devices.yaml", "Main Area"), ], ) -async def test_to_code_records_core_area( +async def test_core_area_recorded_at_config_load( yaml_file: Callable[[str], Path], fixture: str, expected_area: str, ) -> None: - """``to_code`` records the node's area name on CORE for StorageJSON.""" + """The node's area name is recorded on CORE for StorageJSON. + + It must be set during config load (preload_core_config), not deferred to + to_code(): storage.json is written before to_code() runs, so a late + assignment left the area as null in storage.json (regression #17218). + """ result = load_config_from_fixture(yaml_file, fixture, FIXTURES_DIR) assert result is not None - assert CORE.area is None + # Recorded already at config-load time, before any code generation. + assert CORE.area == expected_area with patch("esphome.core.config.cg") as mock_cg: mock_cg.RawStatement.side_effect = lambda *args, **kwargs: MagicMock() @@ -170,6 +176,23 @@ async def test_to_code_records_core_area( assert CORE.area == expected_area +def test_config_load_without_area_clears_stale_core_area( + yaml_file: Callable[[str], Path], +) -> None: + """A config without an area must not inherit a stale CORE.area. + + preload_core_config assigns CORE.area unconditionally, so the area from a + previous load in a long-running process cannot leak into a config that + omits it. + """ + CORE.area = "Stale Area From Previous Load" + result = load_config_from_fixture( + yaml_file, "device_without_area.yaml", FIXTURES_DIR + ) + assert result is not None + assert CORE.area is None + + def test_legacy_string_area( yaml_file: Callable[[str], str], caplog: pytest.LogCaptureFixture ) -> None: From 62e19bcb274c5deef15a8a2d05b4dc6236c0ea77 Mon Sep 17 00:00:00 2001 From: "esphome[bot]" <115708604+esphome[bot]@users.noreply.github.com> Date: Sat, 27 Jun 2026 15:00:23 -0700 Subject: [PATCH 20/26] Bump bundled esphome-device-builder to 1.0.20 (#17244) --- docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 4a375ed15b..99b4b1b39d 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -32,7 +32,7 @@ RUN \ -r /requirements.txt # Install the ESPHome Device Builder dashboard. -RUN uv pip install --no-cache-dir esphome-device-builder==1.0.19 +RUN uv pip install --no-cache-dir esphome-device-builder==1.0.20 RUN \ platformio settings set enable_telemetry No \ From 1793ca5eac9e055c3dd19a882f45485e777b627b Mon Sep 17 00:00:00 2001 From: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com> Date: Sat, 27 Jun 2026 18:05:00 -0400 Subject: [PATCH 21/26] [core] Suppress unactionable legacy-redaction warning for substitutions (#17242) --- esphome/__main__.py | 27 ++++++++++++++++++++++----- tests/unit_tests/test_main.py | 30 ++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 5 deletions(-) diff --git a/esphome/__main__.py b/esphome/__main__.py index bda3dcbd05..bec00cca60 100644 --- a/esphome/__main__.py +++ b/esphome/__main__.py @@ -1470,12 +1470,29 @@ _LEGACY_REDACTION_REMOVAL = "2026.12.0" def _redact_with_legacy_fallback(output: str) -> str: unmarked: set[str] = set() + # Track the top-level ``substitutions:`` block. Its keys are arbitrary + # user-chosen names with no schema validator, so the ``cv.sensitive(...)`` + # migration named in the warning can't be applied to them. Their values are + # still redacted, but emitting the (unactionable) deprecation warning would + # only confuse users. + in_substitutions = False - def _replace(m: re.Match[str]) -> str: - unmarked.add(m.group("key")) - return f"{m.group('key')}: \\033[8m{m.group('val')}\\033[28m" - - output = _LEGACY_REDACTION_RE.sub(_replace, output) + lines = output.split("\n") + for i, line in enumerate(lines): + # A non-indented, non-blank line is a top-level key that opens or + # closes the substitutions block. + if line and not line[0].isspace(): + in_substitutions = line.startswith(f"{CONF_SUBSTITUTIONS}:") + m = _LEGACY_REDACTION_RE.search(line) + if m is None: + continue + if not in_substitutions: + unmarked.add(m.group("key")) + lines[i] = ( + f"{line[: m.start()]}{m.group('key')}: " + f"\\033[8m{m.group('val')}\\033[28m{line[m.end() :]}" + ) + output = "\n".join(lines) for key in sorted(unmarked): _LOGGER.warning( "Field '%s' is being redacted by a legacy substring heuristic. " diff --git a/tests/unit_tests/test_main.py b/tests/unit_tests/test_main.py index acd39cedc6..eb39ceab2a 100644 --- a/tests/unit_tests/test_main.py +++ b/tests/unit_tests/test_main.py @@ -437,6 +437,36 @@ def test_redact_with_legacy_fallback__does_not_match_fragment_as_suffix( assert not any("legacy substring" in rec.message for rec in caplog.records) +def test_redact_with_legacy_fallback__substitutions_redacted_without_warning( + caplog: pytest.LogCaptureFixture, +) -> None: + """Substitution keys have no schema validator, so their values are still + redacted but the unactionable cv.sensitive migration warning is suppressed + (see issue #17225).""" + text = "substitutions:\n ota_password: apolloautomation\nesphome:\n name: x\n" + with caplog.at_level(logging.WARNING, logger="esphome.__main__"): + out = _redact_with_legacy_fallback(text) + assert "ota_password: \\033[8mapolloautomation\\033[28m" in out + assert not any("legacy substring" in rec.message for rec in caplog.records) + + +def test_redact_with_legacy_fallback__warns_after_substitutions_block( + caplog: pytest.LogCaptureFixture, +) -> None: + """The suppression ends at the next top-level key; a sensitive-shaped field + in a later block (a real schema field) still warns, while the substitution + above it does not.""" + text = ( + "substitutions:\n ota_password: apolloautomation\nwifi:\n password: hunter2\n" + ) + with caplog.at_level(logging.WARNING, logger="esphome.__main__"): + out = _redact_with_legacy_fallback(text) + assert "ota_password: \\033[8mapolloautomation\\033[28m" in out + assert "password: \\033[8mhunter2\\033[28m" in out + assert any("'password'" in rec.message for rec in caplog.records) + assert not any("ota_password" in rec.message for rec in caplog.records) + + def test_command_config__invokes_legacy_fallback_when_redacting( tmp_path: Path, capfd: CaptureFixture[str] ) -> None: From 14b6a0ede1a90f6a67e4b3d93e192fef808b6560 Mon Sep 17 00:00:00 2001 From: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com> Date: Sat, 27 Jun 2026 18:17:09 -0400 Subject: [PATCH 22/26] [espnow] Don't throttle ESP-NOW RX when deep_sleep is present (#17240) --- esphome/components/espnow/espnow_component.cpp | 8 -------- 1 file changed, 8 deletions(-) diff --git a/esphome/components/espnow/espnow_component.cpp b/esphome/components/espnow/espnow_component.cpp index 403e6f4944..f89b4a2ff1 100644 --- a/esphome/components/espnow/espnow_component.cpp +++ b/esphome/components/espnow/espnow_component.cpp @@ -28,9 +28,6 @@ namespace esphome::espnow { static constexpr const char *TAG = "espnow"; -static const esp_err_t CONFIG_ESPNOW_WAKE_WINDOW = 50; -static const esp_err_t CONFIG_ESPNOW_WAKE_INTERVAL = 100; - ESPNowComponent *global_esp_now = nullptr; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables) static const LogString *espnow_error_to_str(esp_err_t error) { @@ -204,11 +201,6 @@ void ESPNowComponent::enable_() { esp_wifi_get_mac(WIFI_IF_STA, this->own_address_); -#ifdef USE_DEEP_SLEEP - esp_now_set_wake_window(CONFIG_ESPNOW_WAKE_WINDOW); - esp_wifi_connectionless_module_set_wake_interval(CONFIG_ESPNOW_WAKE_INTERVAL); -#endif - this->state_ = ESPNOW_STATE_ENABLED; for (auto peer : this->peers_) { From 24d8e99c507e7b44019c427af8987350fbba4ee6 Mon Sep 17 00:00:00 2001 From: "esphome[bot]" <115708604+esphome[bot]@users.noreply.github.com> Date: Sun, 28 Jun 2026 09:41:49 -0700 Subject: [PATCH 23/26] Bump bundled esphome-device-builder to 1.0.21 (#17257) Co-authored-by: esphome[bot] <115708604+esphome[bot]@users.noreply.github.com> --- docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 99b4b1b39d..8dce7861df 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -32,7 +32,7 @@ RUN \ -r /requirements.txt # Install the ESPHome Device Builder dashboard. -RUN uv pip install --no-cache-dir esphome-device-builder==1.0.20 +RUN uv pip install --no-cache-dir esphome-device-builder==1.0.21 RUN \ platformio settings set enable_telemetry No \ From 4fbe0d87ec3ff43e32f68ad515b359511c0e5863 Mon Sep 17 00:00:00 2001 From: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com> Date: Sun, 28 Jun 2026 15:16:42 -0400 Subject: [PATCH 24/26] [wifi] Fix crash when WiFi is enabled late alongside ESP-NOW (#17239) --- .../wifi/wifi_component_esp_idf.cpp | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/esphome/components/wifi/wifi_component_esp_idf.cpp b/esphome/components/wifi/wifi_component_esp_idf.cpp index b395c77141..2ade015a25 100644 --- a/esphome/components/wifi/wifi_component_esp_idf.cpp +++ b/esphome/components/wifi/wifi_component_esp_idf.cpp @@ -179,12 +179,53 @@ void WiFiComponent::wifi_lazy_init_() { // nor re-register the default WiFi handlers. if (s_sta_netif == nullptr) s_sta_netif = esp_netif_create_default_wifi_sta(); + if (s_sta_netif == nullptr) { + // Allocation failed; leave wifi_initialized_ false so a later enable() retries. + ESP_LOGE(TAG, "esp_netif_create_default_wifi_sta failed"); + return; + } #ifdef USE_WIFI_AP if (s_ap_netif == nullptr) s_ap_netif = esp_netif_create_default_wifi_ap(); #endif // USE_WIFI_AP + // The WiFi driver was started (e.g. by ESP-NOW with the wifi component disabled at + // boot) before our STA netif existed. The default WIFI_EVENT_STA_START handler + // therefore ran with no netif and never called esp_wifi_register_if_rxcb() -- the + // only thing that points the driver's RX path at a netif (it sets + // s_wifi_netifs[WIFI_IF_STA]). A bare esp_netif_action_start() would stop the + // immediate crash (#17232) but leaves RX unbound, so the first association + // associates at L2 yet never receives DHCP replies and times out (#17239). Restart + // the driver now that the netif exists so STA_START re-runs the default handler and + // wires RX correctly. ESP-NOW survives the stop/start (its peer state persists). + // This also matches a self-retry: if esp_wifi_set_storage() below failed on a + // previous wifi_lazy_init_() it returned without setting wifi_initialized_, and + // esp_wifi_init() has since run, so esp_wifi_get_mode() now succeeds here too. + wifi_mode_t mode; + if (esp_wifi_get_mode(&mode) == ESP_OK) { + ESP_LOGD(TAG, "WiFi driver already started without STA netif; restarting to bind it"); + esp_err_t err = esp_wifi_stop(); + if (err != ESP_OK) { + ESP_LOGW(TAG, "esp_wifi_stop failed: %s", esp_err_to_name(err)); + } + // Re-apply RAM storage; the normal init path does this, but it is skipped on + // the self-retry case above, which would otherwise let the driver persist + // credentials to NVS for the rest of the boot. + err = esp_wifi_set_storage(WIFI_STORAGE_RAM); + if (err != ESP_OK) { + ESP_LOGW(TAG, "esp_wifi_set_storage failed: %s", esp_err_to_name(err)); + } + err = esp_wifi_start(); + if (err != ESP_OK) { + ESP_LOGE(TAG, "esp_wifi_start failed: %s", esp_err_to_name(err)); + return; + } + s_wifi_started = true; + this->wifi_initialized_ = true; + return; + } + wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT(); if (global_preferences->nvs_handle == 0) { ESP_LOGW(TAG, "starting wifi without nvs"); From 6251c26cc6c16f0b4318a4d6d96f90ce5706bf94 Mon Sep 17 00:00:00 2001 From: Tom <7723105+thomasfw@users.noreply.github.com> Date: Mon, 29 Jun 2026 04:06:12 +0100 Subject: [PATCH 25/26] [espnow] Fix espnow crash when send() is called without a callback (#17266) --- esphome/components/espnow/espnow_component.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/esphome/components/espnow/espnow_component.cpp b/esphome/components/espnow/espnow_component.cpp index f89b4a2ff1..2756b615a1 100644 --- a/esphome/components/espnow/espnow_component.cpp +++ b/esphome/components/espnow/espnow_component.cpp @@ -303,7 +303,9 @@ void ESPNowComponent::loop() { ESP_LOGV(TAG, ">>> [%s] %s", addr_buf, LOG_STR_ARG(espnow_error_to_str(packet->packet_.sent.status))); #endif if (this->current_send_packet_ != nullptr) { - this->current_send_packet_->callback_(packet->packet_.sent.status); + if (this->current_send_packet_->callback_ != nullptr) { + this->current_send_packet_->callback_(packet->packet_.sent.status); + } this->send_packet_pool_.release(this->current_send_packet_); this->current_send_packet_ = nullptr; // Reset current packet after sending } From a618ee11b41a9baab68ac718fd7124382a39f598 Mon Sep 17 00:00:00 2001 From: Jesse Hills <3060199+jesserockz@users.noreply.github.com> Date: Mon, 29 Jun 2026 20:30:24 +1200 Subject: [PATCH 26/26] Bump version to 2026.6.3 --- Doxyfile | 2 +- esphome/const.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Doxyfile b/Doxyfile index ea36d45fee..bc92241937 100644 --- a/Doxyfile +++ b/Doxyfile @@ -48,7 +48,7 @@ PROJECT_NAME = ESPHome # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 2026.6.2 +PROJECT_NUMBER = 2026.6.3 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/esphome/const.py b/esphome/const.py index 7cc9b604d9..b7ffb9121d 100644 --- a/esphome/const.py +++ b/esphome/const.py @@ -4,7 +4,7 @@ from enum import Enum from esphome.enum import StrEnum -__version__ = "2026.6.2" +__version__ = "2026.6.3" ALLOWED_NAME_CHARS = "abcdefghijklmnopqrstuvwxyz0123456789-_" VALID_SUBSTITUTIONS_CHARACTERS = (