From b8353b3117de858f3f969be7995f9f2549420c69 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 16 Oct 2025 20:52:22 +0000 Subject: [PATCH 1/5] Bump ruff from 0.14.0 to 0.14.1 (#11303) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: J. Nick Koston --- .pre-commit-config.yaml | 2 +- requirements_test.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 521aaf9cc8..9e0e71d388 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,7 +11,7 @@ ci: repos: - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: v0.14.0 + rev: v0.14.1 hooks: # Run the linter. - id: ruff diff --git a/requirements_test.txt b/requirements_test.txt index 56ac775a94..4c60a31d7f 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -1,6 +1,6 @@ pylint==4.0.1 flake8==7.3.0 # also change in .pre-commit-config.yaml when updating -ruff==0.14.0 # also change in .pre-commit-config.yaml when updating +ruff==0.14.1 # also change in .pre-commit-config.yaml when updating pyupgrade==3.21.0 # also change in .pre-commit-config.yaml when updating pre-commit From cd1215347e0f879c9418e449bb184be3956c0c62 Mon Sep 17 00:00:00 2001 From: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com> Date: Thu, 16 Oct 2025 16:55:30 -0400 Subject: [PATCH 2/5] [esp32] Reduce tx power on Arduino (#11304) --- esphome/components/esp32/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/esphome/components/esp32/__init__.py b/esphome/components/esp32/__init__.py index 92f5c57638..deb80deaf9 100644 --- a/esphome/components/esp32/__init__.py +++ b/esphome/components/esp32/__init__.py @@ -805,6 +805,7 @@ async def to_code(config): add_idf_sdkconfig_option("CONFIG_AUTOSTART_ARDUINO", True) add_idf_sdkconfig_option("CONFIG_MBEDTLS_PSK_MODES", True) add_idf_sdkconfig_option("CONFIG_MBEDTLS_CERTIFICATE_BUNDLE", True) + add_idf_sdkconfig_option("CONFIG_ESP_PHY_REDUCE_TX_POWER", True) cg.add_build_flag("-Wno-nonnull-compare") From 62f73c768e8e61da2265962e824732d0d15cdbea Mon Sep 17 00:00:00 2001 From: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com> Date: Thu, 16 Oct 2025 17:43:15 -0400 Subject: [PATCH 3/5] [esp32] Reduce tx power on IDF in the event of a brownout (#11306) --- esphome/components/esp32/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/esphome/components/esp32/__init__.py b/esphome/components/esp32/__init__.py index deb80deaf9..b7dd25e0d8 100644 --- a/esphome/components/esp32/__init__.py +++ b/esphome/components/esp32/__init__.py @@ -805,7 +805,6 @@ async def to_code(config): add_idf_sdkconfig_option("CONFIG_AUTOSTART_ARDUINO", True) add_idf_sdkconfig_option("CONFIG_MBEDTLS_PSK_MODES", True) add_idf_sdkconfig_option("CONFIG_MBEDTLS_CERTIFICATE_BUNDLE", True) - add_idf_sdkconfig_option("CONFIG_ESP_PHY_REDUCE_TX_POWER", True) cg.add_build_flag("-Wno-nonnull-compare") @@ -829,6 +828,9 @@ async def to_code(config): # Disable dynamic log level control to save memory add_idf_sdkconfig_option("CONFIG_LOG_DYNAMIC_LEVEL_CONTROL", False) + # Reduce PHY TX power in the event of a brownout + add_idf_sdkconfig_option("CONFIG_ESP_PHY_REDUCE_TX_POWER", True) + # Set default CPU frequency add_idf_sdkconfig_option( f"CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_{config[CONF_CPU_FREQUENCY][:-3]}", True From 076313b85073f9974dac9195fbec510ba17358e3 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Thu, 16 Oct 2025 14:09:09 -1000 Subject: [PATCH 4/5] [core] Fix IndexError when OTA devices cannot be resolved --- esphome/__main__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/esphome/__main__.py b/esphome/__main__.py index d9bdfb175b..d7f11feef9 100644 --- a/esphome/__main__.py +++ b/esphome/__main__.py @@ -185,7 +185,9 @@ def choose_upload_log_host( else: resolved.append(device) if not resolved: - _LOGGER.error("All specified devices: %s could not be resolved.", defaults) + raise EsphomeError( + f"All specified devices {defaults} could not be resolved. Is the device connected to the network?" + ) return resolved # No devices specified, show interactive chooser From 8b5509328e5b5a19dc286ef4ba639d52871fb1b3 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Thu, 16 Oct 2025 14:12:55 -1000 Subject: [PATCH 5/5] adjust tesdts --- tests/unit_tests/test_main.py | 78 +++++++++++++++++++---------------- 1 file changed, 42 insertions(+), 36 deletions(-) diff --git a/tests/unit_tests/test_main.py b/tests/unit_tests/test_main.py index 59d0433aa4..73dfe359f0 100644 --- a/tests/unit_tests/test_main.py +++ b/tests/unit_tests/test_main.py @@ -321,12 +321,14 @@ def test_choose_upload_log_host_with_serial_device_no_ports( ) -> None: """Test SERIAL device when no serial ports are found.""" setup_core() - result = choose_upload_log_host( - default="SERIAL", - check_default=None, - purpose=Purpose.UPLOADING, - ) - assert result == [] + with pytest.raises( + EsphomeError, match="All specified devices .* could not be resolved" + ): + choose_upload_log_host( + default="SERIAL", + check_default=None, + purpose=Purpose.UPLOADING, + ) assert "No serial ports found, skipping SERIAL device" in caplog.text @@ -367,12 +369,14 @@ def test_choose_upload_log_host_with_ota_device_with_api_config() -> None: """Test OTA device when API is configured (no upload without OTA in config).""" setup_core(config={CONF_API: {}}, address="192.168.1.100") - result = choose_upload_log_host( - default="OTA", - check_default=None, - purpose=Purpose.UPLOADING, - ) - assert result == [] + with pytest.raises( + EsphomeError, match="All specified devices .* could not be resolved" + ): + choose_upload_log_host( + default="OTA", + check_default=None, + purpose=Purpose.UPLOADING, + ) def test_choose_upload_log_host_with_ota_device_with_api_config_logging() -> None: @@ -405,12 +409,14 @@ def test_choose_upload_log_host_with_ota_device_no_fallback() -> None: """Test OTA device with no valid fallback options.""" setup_core() - result = choose_upload_log_host( - default="OTA", - check_default=None, - purpose=Purpose.UPLOADING, - ) - assert result == [] + with pytest.raises( + EsphomeError, match="All specified devices .* could not be resolved" + ): + choose_upload_log_host( + default="OTA", + check_default=None, + purpose=Purpose.UPLOADING, + ) @pytest.mark.usefixtures("mock_choose_prompt") @@ -615,21 +621,19 @@ def test_choose_upload_log_host_empty_defaults_list() -> None: @pytest.mark.usefixtures("mock_no_serial_ports", "mock_no_mqtt_logging") -def test_choose_upload_log_host_all_devices_unresolved( - caplog: pytest.LogCaptureFixture, -) -> None: +def test_choose_upload_log_host_all_devices_unresolved() -> None: """Test when all specified devices cannot be resolved.""" setup_core() - result = choose_upload_log_host( - default=["SERIAL", "OTA"], - check_default=None, - purpose=Purpose.UPLOADING, - ) - assert result == [] - assert ( - "All specified devices: ['SERIAL', 'OTA'] could not be resolved." in caplog.text - ) + with pytest.raises( + EsphomeError, + match=r"All specified devices \['SERIAL', 'OTA'\] could not be resolved", + ): + choose_upload_log_host( + default=["SERIAL", "OTA"], + check_default=None, + purpose=Purpose.UPLOADING, + ) @pytest.mark.usefixtures("mock_no_serial_ports", "mock_no_mqtt_logging") @@ -762,12 +766,14 @@ def test_choose_upload_log_host_no_address_with_ota_config() -> None: """Test OTA device when OTA is configured but no address is set.""" setup_core(config={CONF_OTA: {}}) - result = choose_upload_log_host( - default="OTA", - check_default=None, - purpose=Purpose.UPLOADING, - ) - assert result == [] + with pytest.raises( + EsphomeError, match="All specified devices .* could not be resolved" + ): + choose_upload_log_host( + default="OTA", + check_default=None, + purpose=Purpose.UPLOADING, + ) @dataclass