From 66b46ea81e8ffeef6f3cc904f77e1d53b7f1e769 Mon Sep 17 00:00:00 2001 From: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com> Date: Mon, 22 Dec 2025 11:00:27 -0500 Subject: [PATCH 1/7] [core] Deprecate using_esp_idf, replace with is_esp32 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Arduino on ESP32 now builds ESP-IDF as a component, so add_idf_sdkconfig_option() and add_idf_component() work with both Arduino and ESP-IDF frameworks. The using_esp_idf property is deprecated and now emits a warning. All internal usages have been replaced with is_esp32. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- esphome/components/captive_portal/__init__.py | 2 +- esphome/components/i2c/__init__.py | 2 +- esphome/components/i2s_audio/__init__.py | 2 +- esphome/components/improv_serial/__init__.py | 2 +- esphome/components/mdns/__init__.py | 2 +- esphome/components/network/__init__.py | 10 +++------- esphome/components/wifi/__init__.py | 4 ++-- esphome/core/__init__.py | 5 +++++ 8 files changed, 15 insertions(+), 14 deletions(-) diff --git a/esphome/components/captive_portal/__init__.py b/esphome/components/captive_portal/__init__.py index 25d0a22083..763e2e4ec5 100644 --- a/esphome/components/captive_portal/__init__.py +++ b/esphome/components/captive_portal/__init__.py @@ -25,7 +25,7 @@ _LOGGER = logging.getLogger(__name__) def AUTO_LOAD() -> list[str]: auto_load = ["web_server_base", "ota.web_server"] - if CORE.using_esp_idf: + if CORE.is_esp32: auto_load.append("socket") return auto_load diff --git a/esphome/components/i2c/__init__.py b/esphome/components/i2c/__init__.py index 7706484e97..b68f0490e1 100644 --- a/esphome/components/i2c/__init__.py +++ b/esphome/components/i2c/__init__.py @@ -146,7 +146,7 @@ def _final_validate(config): full_config = fv.full_config.get()[CONF_I2C] if CORE.using_zephyr and len(full_config) > 1: raise cv.Invalid("Second i2c is not implemented on Zephyr yet") - if CORE.using_esp_idf and get_esp32_variant() in ESP32_I2C_CAPABILITIES: + if CORE.is_esp32 and get_esp32_variant() in ESP32_I2C_CAPABILITIES: variant = get_esp32_variant() max_num = ESP32_I2C_CAPABILITIES[variant]["NUM"] if len(full_config) > max_num: diff --git a/esphome/components/i2s_audio/__init__.py b/esphome/components/i2s_audio/__init__.py index 61c5ca4ec1..1e4fa56b78 100644 --- a/esphome/components/i2s_audio/__init__.py +++ b/esphome/components/i2s_audio/__init__.py @@ -262,7 +262,7 @@ def _final_validate(_): def use_legacy(): legacy_driver = _get_use_legacy_driver() - return not (CORE.using_esp_idf and not legacy_driver) + return not (CORE.is_esp32 and not legacy_driver) FINAL_VALIDATE_SCHEMA = _final_validate diff --git a/esphome/components/improv_serial/__init__.py b/esphome/components/improv_serial/__init__.py index 7f88b17e11..9a2ac2f40f 100644 --- a/esphome/components/improv_serial/__init__.py +++ b/esphome/components/improv_serial/__init__.py @@ -26,7 +26,7 @@ def validate_logger(config): logger_conf = fv.full_config.get()[CONF_LOGGER] if logger_conf[CONF_BAUD_RATE] == 0: raise cv.Invalid("improv_serial requires the logger baud_rate to be not 0") - if CORE.using_esp_idf and ( + if CORE.is_esp32 and ( logger_conf[CONF_HARDWARE_UART] == USB_CDC and get_esp32_variant() == VARIANT_ESP32S3 ): diff --git a/esphome/components/mdns/__init__.py b/esphome/components/mdns/__init__.py index 99b728b249..77cca9e00c 100644 --- a/esphome/components/mdns/__init__.py +++ b/esphome/components/mdns/__init__.py @@ -164,7 +164,7 @@ async def to_code(config): elif CORE.is_rp2040: cg.add_library("LEAmDNS", None) - if CORE.using_esp_idf: + if CORE.is_esp32: add_idf_component(name="espressif/mdns", ref="1.9.1") cg.add_define("USE_MDNS") diff --git a/esphome/components/network/__init__.py b/esphome/components/network/__init__.py index d7a51fb0c6..b63de261f3 100644 --- a/esphome/components/network/__init__.py +++ b/esphome/components/network/__init__.py @@ -156,7 +156,7 @@ async def to_code(config): "High performance networking disabled by user configuration (overriding component request)" ) - if CORE.is_esp32 and CORE.using_esp_idf and should_enable: + if CORE.is_esp32 and should_enable: # Check if PSRAM is guaranteed (set by psram component during final validation) psram_guaranteed = psram_is_guaranteed() @@ -210,12 +210,8 @@ async def to_code(config): "USE_NETWORK_MIN_IPV6_ADDR_COUNT", config[CONF_MIN_IPV6_ADDR_COUNT] ) if CORE.is_esp32: - if CORE.using_esp_idf: - add_idf_sdkconfig_option("CONFIG_LWIP_IPV6", enable_ipv6) - add_idf_sdkconfig_option("CONFIG_LWIP_IPV6_AUTOCONFIG", enable_ipv6) - else: - add_idf_sdkconfig_option("CONFIG_LWIP_IPV6", True) - add_idf_sdkconfig_option("CONFIG_LWIP_IPV6_AUTOCONFIG", True) + add_idf_sdkconfig_option("CONFIG_LWIP_IPV6", enable_ipv6) + add_idf_sdkconfig_option("CONFIG_LWIP_IPV6_AUTOCONFIG", enable_ipv6) elif enable_ipv6: cg.add_build_flag("-DCONFIG_LWIP_IPV6") cg.add_build_flag("-DCONFIG_LWIP_IPV6_AUTOCONFIG") diff --git a/esphome/components/wifi/__init__.py b/esphome/components/wifi/__init__.py index 2c10506011..1b6a8dffa9 100644 --- a/esphome/components/wifi/__init__.py +++ b/esphome/components/wifi/__init__.py @@ -468,7 +468,7 @@ async def to_code(config): ) cg.add(var.set_ap_timeout(conf[CONF_AP_TIMEOUT])) cg.add_define("USE_WIFI_AP") - elif CORE.is_esp32 and CORE.using_esp_idf: + elif CORE.is_esp32: add_idf_sdkconfig_option("CONFIG_ESP_WIFI_SOFTAP_SUPPORT", False) add_idf_sdkconfig_option("CONFIG_LWIP_DHCPS", False) @@ -513,7 +513,7 @@ async def to_code(config): add_idf_sdkconfig_option("CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP", True) # Apply high performance WiFi settings if high performance networking is enabled - if CORE.is_esp32 and CORE.using_esp_idf and has_high_performance_networking(): + if CORE.is_esp32 and has_high_performance_networking(): # Check if PSRAM is guaranteed (set by psram component during final validation) psram_guaranteed = psram_is_guaranteed() diff --git a/esphome/core/__init__.py b/esphome/core/__init__.py index ad9844a3bf..8c823f112d 100644 --- a/esphome/core/__init__.py +++ b/esphome/core/__init__.py @@ -798,6 +798,11 @@ class EsphomeCore: @property def using_esp_idf(self): + # Deprecated: use is_esp32 instead, as Arduino also builds ESP-IDF + logging.getLogger(__name__).warning( + "CORE.using_esp_idf is deprecated, use CORE.is_esp32 instead. " + "Arduino on ESP32 also uses ESP-IDF." + ) return self.target_framework == "esp-idf" @property From 63b8fa004c38e921f9afdba02b1593f1fcc2bce3 Mon Sep 17 00:00:00 2001 From: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com> Date: Mon, 22 Dec 2025 11:09:37 -0500 Subject: [PATCH 2/7] [core] Fix mdns and network for using_esp_idf deprecation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - mdns: Remove ESPmDNS Arduino library for ESP32, use IDF component for both frameworks - network: Use using_arduino for IPv6 to maintain Arduino behavior (always True) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- esphome/components/mdns/__init__.py | 4 +--- esphome/components/network/__init__.py | 8 ++++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/esphome/components/mdns/__init__.py b/esphome/components/mdns/__init__.py index 77cca9e00c..3088d8ad7e 100644 --- a/esphome/components/mdns/__init__.py +++ b/esphome/components/mdns/__init__.py @@ -157,9 +157,7 @@ async def to_code(config): return if CORE.using_arduino: - if CORE.is_esp32: - cg.add_library("ESPmDNS", None) - elif CORE.is_esp8266: + if CORE.is_esp8266: cg.add_library("ESP8266mDNS", None) elif CORE.is_rp2040: cg.add_library("LEAmDNS", None) diff --git a/esphome/components/network/__init__.py b/esphome/components/network/__init__.py index b63de261f3..5b63bbfce9 100644 --- a/esphome/components/network/__init__.py +++ b/esphome/components/network/__init__.py @@ -210,8 +210,12 @@ async def to_code(config): "USE_NETWORK_MIN_IPV6_ADDR_COUNT", config[CONF_MIN_IPV6_ADDR_COUNT] ) if CORE.is_esp32: - add_idf_sdkconfig_option("CONFIG_LWIP_IPV6", enable_ipv6) - add_idf_sdkconfig_option("CONFIG_LWIP_IPV6_AUTOCONFIG", enable_ipv6) + if CORE.using_arduino: + add_idf_sdkconfig_option("CONFIG_LWIP_IPV6", True) + add_idf_sdkconfig_option("CONFIG_LWIP_IPV6_AUTOCONFIG", True) + else: + add_idf_sdkconfig_option("CONFIG_LWIP_IPV6", enable_ipv6) + add_idf_sdkconfig_option("CONFIG_LWIP_IPV6_AUTOCONFIG", enable_ipv6) elif enable_ipv6: cg.add_build_flag("-DCONFIG_LWIP_IPV6") cg.add_build_flag("-DCONFIG_LWIP_IPV6_AUTOCONFIG") From c5ac62676c2934f5b8fef2395d47934b63b69f4e Mon Sep 17 00:00:00 2001 From: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com> Date: Mon, 22 Dec 2025 11:19:56 -0500 Subject: [PATCH 3/7] Fix --- esphome/components/i2s_audio/__init__.py | 5 +++-- esphome/core/__init__.py | 4 +--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/esphome/components/i2s_audio/__init__.py b/esphome/components/i2s_audio/__init__.py index 1e4fa56b78..d3128c5f4c 100644 --- a/esphome/components/i2s_audio/__init__.py +++ b/esphome/components/i2s_audio/__init__.py @@ -232,6 +232,8 @@ def validate_use_legacy(value): if (not value[CONF_USE_LEGACY]) and (CORE.using_arduino): raise cv.Invalid("Arduino supports only the legacy i2s driver") _set_use_legacy_driver(value[CONF_USE_LEGACY]) + elif CORE.using_arduino: + _set_use_legacy_driver(True) return value @@ -261,8 +263,7 @@ def _final_validate(_): def use_legacy(): - legacy_driver = _get_use_legacy_driver() - return not (CORE.is_esp32 and not legacy_driver) + return _get_use_legacy_driver() FINAL_VALIDATE_SCHEMA = _final_validate diff --git a/esphome/core/__init__.py b/esphome/core/__init__.py index 8c823f112d..73b683aa60 100644 --- a/esphome/core/__init__.py +++ b/esphome/core/__init__.py @@ -798,10 +798,8 @@ class EsphomeCore: @property def using_esp_idf(self): - # Deprecated: use is_esp32 instead, as Arduino also builds ESP-IDF logging.getLogger(__name__).warning( - "CORE.using_esp_idf is deprecated, use CORE.is_esp32 instead. " - "Arduino on ESP32 also uses ESP-IDF." + "CORE.using_esp_idf was deprecated in 2026.1, use CORE.is_esp32 and/or CORE.using_arduino instead." ) return self.target_framework == "esp-idf" From 4ffbdd9a3ad0600b977cc5746665a3687c96d41d Mon Sep 17 00:00:00 2001 From: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com> Date: Mon, 22 Dec 2025 11:23:43 -0500 Subject: [PATCH 4/7] Fix --- esphome/components/wifi/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esphome/components/wifi/__init__.py b/esphome/components/wifi/__init__.py index 1b6a8dffa9..fbb89e8ffe 100644 --- a/esphome/components/wifi/__init__.py +++ b/esphome/components/wifi/__init__.py @@ -468,7 +468,7 @@ async def to_code(config): ) cg.add(var.set_ap_timeout(conf[CONF_AP_TIMEOUT])) cg.add_define("USE_WIFI_AP") - elif CORE.is_esp32: + elif CORE.is_esp32 and not CORE.using_arduino: add_idf_sdkconfig_option("CONFIG_ESP_WIFI_SOFTAP_SUPPORT", False) add_idf_sdkconfig_option("CONFIG_LWIP_DHCPS", False) From bee58474645246803f54821ea65efe3e686e3fe0 Mon Sep 17 00:00:00 2001 From: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com> Date: Mon, 22 Dec 2025 11:34:49 -0500 Subject: [PATCH 5/7] Fix --- esphome/core/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/esphome/core/__init__.py b/esphome/core/__init__.py index 73b683aa60..9896b8c87f 100644 --- a/esphome/core/__init__.py +++ b/esphome/core/__init__.py @@ -799,7 +799,8 @@ class EsphomeCore: @property def using_esp_idf(self): logging.getLogger(__name__).warning( - "CORE.using_esp_idf was deprecated in 2026.1, use CORE.is_esp32 and/or CORE.using_arduino instead." + "CORE.using_esp_idf was deprecated in 2026.1, use CORE.is_esp32 and/or CORE.using_arduino instead. " + "ESP32 Arduino builds on top of ESP-IDF, so ESP-IDF features are available in both frameworks." ) return self.target_framework == "esp-idf" From ce86f01cba3aafddfff037b87eaf7eb9841212ee Mon Sep 17 00:00:00 2001 From: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com> Date: Mon, 22 Dec 2025 12:02:26 -0500 Subject: [PATCH 6/7] Change --- esphome/core/__init__.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/esphome/core/__init__.py b/esphome/core/__init__.py index 9896b8c87f..ad9844a3bf 100644 --- a/esphome/core/__init__.py +++ b/esphome/core/__init__.py @@ -798,10 +798,6 @@ class EsphomeCore: @property def using_esp_idf(self): - logging.getLogger(__name__).warning( - "CORE.using_esp_idf was deprecated in 2026.1, use CORE.is_esp32 and/or CORE.using_arduino instead. " - "ESP32 Arduino builds on top of ESP-IDF, so ESP-IDF features are available in both frameworks." - ) return self.target_framework == "esp-idf" @property From 03db8e4f5401f31e11dfd5e996b78bc265253bae Mon Sep 17 00:00:00 2001 From: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com> Date: Mon, 22 Dec 2025 12:22:04 -0500 Subject: [PATCH 7/7] Fix --- esphome/core/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esphome/core/__init__.py b/esphome/core/__init__.py index ad9844a3bf..88700476bf 100644 --- a/esphome/core/__init__.py +++ b/esphome/core/__init__.py @@ -798,7 +798,7 @@ class EsphomeCore: @property def using_esp_idf(self): - return self.target_framework == "esp-idf" + return self.target_platform == PLATFORM_ESP32 @property def using_zephyr(self):