From 6a48665ed0eda5f5b69c8ba0710ef5394c23c63a Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Thu, 29 Jan 2026 12:25:52 -0600 Subject: [PATCH] clarify this is builtin components --- esphome/components/adc/sensor.py | 4 ++-- esphome/components/audio/__init__.py | 4 ++-- esphome/components/display/__init__.py | 4 ++-- esphome/components/esp32/__init__.py | 22 +++++++++---------- .../components/esp32_rmt_led_strip/light.py | 4 ++-- esphome/components/esp32_touch/__init__.py | 4 ++-- esphome/components/ethernet/__init__.py | 4 ++-- esphome/components/http_request/__init__.py | 2 +- esphome/components/i2s_audio/__init__.py | 4 ++-- esphome/components/mqtt/__init__.py | 7 ++++-- esphome/components/neopixelbus/light.py | 4 ++-- esphome/components/nextion/display.py | 2 +- .../components/remote_receiver/__init__.py | 2 +- .../components/remote_transmitter/__init__.py | 2 +- tests/components/esp32/test.esp32-idf.yaml | 2 +- 15 files changed, 37 insertions(+), 34 deletions(-) diff --git a/esphome/components/adc/sensor.py b/esphome/components/adc/sensor.py index ba87495e9d..bab2762f00 100644 --- a/esphome/components/adc/sensor.py +++ b/esphome/components/adc/sensor.py @@ -2,7 +2,7 @@ import logging import esphome.codegen as cg from esphome.components import sensor, voltage_sampler -from esphome.components.esp32 import get_esp32_variant, include_idf_component +from esphome.components.esp32 import get_esp32_variant, include_builtin_idf_component from esphome.components.nrf52.const import AIN_TO_GPIO, EXTRA_ADC from esphome.components.zephyr import ( zephyr_add_overlay, @@ -119,7 +119,7 @@ async def to_code(config): if CORE.is_esp32: # Re-enable ESP-IDF's ADC driver (excluded by default to save compile time) - include_idf_component("esp_adc") + include_builtin_idf_component("esp_adc") if attenuation := config.get(CONF_ATTENUATION): if attenuation == "auto": diff --git a/esphome/components/audio/__init__.py b/esphome/components/audio/__init__.py index 066dcc312e..f48b776ddd 100644 --- a/esphome/components/audio/__init__.py +++ b/esphome/components/audio/__init__.py @@ -1,5 +1,5 @@ import esphome.codegen as cg -from esphome.components.esp32 import add_idf_component, include_idf_component +from esphome.components.esp32 import add_idf_component, include_builtin_idf_component import esphome.config_validation as cv from esphome.const import CONF_BITS_PER_SAMPLE, CONF_NUM_CHANNELS, CONF_SAMPLE_RATE import esphome.final_validate as fv @@ -167,7 +167,7 @@ def final_validate_audio_schema( async def to_code(config): # Re-enable ESP-IDF's HTTP client (excluded by default to save compile time) - include_idf_component("esp_http_client") + include_builtin_idf_component("esp_http_client") add_idf_component( name="esphome/esp-audio-libs", diff --git a/esphome/components/display/__init__.py b/esphome/components/display/__init__.py index b480b84f6c..695e7cde47 100644 --- a/esphome/components/display/__init__.py +++ b/esphome/components/display/__init__.py @@ -224,6 +224,6 @@ async def to_code(config): cg.add_define("USE_DISPLAY") if CORE.is_esp32: # Re-enable ESP-IDF's LCD driver (excluded by default to save compile time) - from esphome.components.esp32 import include_idf_component + from esphome.components.esp32 import include_builtin_idf_component - include_idf_component("esp_lcd") + include_builtin_idf_component("esp_lcd") diff --git a/esphome/components/esp32/__init__.py b/esphome/components/esp32/__init__.py index 90e1b29b61..1d7ea5395f 100644 --- a/esphome/components/esp32/__init__.py +++ b/esphome/components/esp32/__init__.py @@ -87,7 +87,7 @@ IS_TARGET_PLATFORM = True CONF_ASSERTION_LEVEL = "assertion_level" CONF_COMPILER_OPTIMIZATION = "compiler_optimization" CONF_ENABLE_IDF_EXPERIMENTAL_FEATURES = "enable_idf_experimental_features" -CONF_INCLUDE_IDF_COMPONENTS = "include_idf_components" +CONF_INCLUDE_BUILTIN_IDF_COMPONENTS = "include_builtin_idf_components" CONF_ENABLE_LWIP_ASSERT = "enable_lwip_assert" CONF_ENABLE_OTA_ROLLBACK = "enable_ota_rollback" CONF_EXECUTE_FROM_PSRAM = "execute_from_psram" @@ -117,7 +117,7 @@ COMPILER_OPTIMIZATIONS = { } # ESP-IDF components excluded by default to reduce compile time. -# Components can be re-enabled by calling include_idf_component() in to_code(). +# Components can be re-enabled by calling include_builtin_idf_component() in to_code(). # # Cannot be excluded (dependencies of required components): # - "console": espressif/mdns unconditionally depends on it @@ -235,7 +235,7 @@ def set_core_data(config): ) CORE.data[KEY_ESP32][KEY_SDKCONFIG_OPTIONS] = {} CORE.data[KEY_ESP32][KEY_COMPONENTS] = {} - # Initialize with default exclusions - components can call include_idf_component() + # Initialize with default exclusions - components can call include_builtin_idf_component() # to re-enable any they need CORE.data[KEY_ESP32][KEY_EXCLUDE_COMPONENTS] = set(DEFAULT_EXCLUDED_IDF_COMPONENTS) CORE.data[KEY_CORE][KEY_FRAMEWORK_VERSION] = cv.Version.parse( @@ -363,7 +363,7 @@ def add_idf_component( } -def exclude_idf_component(name: str) -> None: +def exclude_builtin_idf_component(name: str) -> None: """Exclude an ESP-IDF component from the build. This reduces compile time by skipping components that are not needed. @@ -375,7 +375,7 @@ def exclude_idf_component(name: str) -> None: CORE.data[KEY_ESP32][KEY_EXCLUDE_COMPONENTS].add(name) -def include_idf_component(name: str) -> None: +def include_builtin_idf_component(name: str) -> None: """Remove an ESP-IDF component from the exclusion list. Call this from components that need an ESP-IDF component that is @@ -901,9 +901,9 @@ FRAMEWORK_SCHEMA = cv.Schema( cv.Optional( CONF_USE_FULL_CERTIFICATE_BUNDLE, default=False ): cv.boolean, - cv.Optional(CONF_INCLUDE_IDF_COMPONENTS, default=[]): cv.ensure_list( - cv.string_strict - ), + cv.Optional( + CONF_INCLUDE_BUILTIN_IDF_COMPONENTS, default=[] + ): cv.ensure_list(cv.string_strict), cv.Optional(CONF_DISABLE_DEBUG_STUBS, default=True): cv.boolean, cv.Optional(CONF_DISABLE_OCD_AWARE, default=True): cv.boolean, cv.Optional( @@ -1331,8 +1331,8 @@ async def to_code(config): advanced = conf[CONF_ADVANCED] # Re-include any IDF components the user explicitly requested - for component_name in advanced.get(CONF_INCLUDE_IDF_COMPONENTS, []): - include_idf_component(component_name) + for component_name in advanced.get(CONF_INCLUDE_BUILTIN_IDF_COMPONENTS, []): + include_builtin_idf_component(component_name) # DHCP server: only disable if explicitly set to false # WiFi component handles its own optimization when AP mode is not used @@ -1519,7 +1519,7 @@ async def to_code(config): CORE.add_job(_add_yaml_idf_components, conf[CONF_COMPONENTS]) # Write EXCLUDE_COMPONENTS at FINAL priority after all components have had - # a chance to call include_idf_component() to re-enable components they need. + # a chance to call include_builtin_idf_component() to re-enable components they need. # Default exclusions are added in set_core_data() during config validation. CORE.add_job(_write_exclude_components) diff --git a/esphome/components/esp32_rmt_led_strip/light.py b/esphome/components/esp32_rmt_led_strip/light.py index 4eed459bd1..6d41f6b5b8 100644 --- a/esphome/components/esp32_rmt_led_strip/light.py +++ b/esphome/components/esp32_rmt_led_strip/light.py @@ -5,7 +5,7 @@ from esphome import pins import esphome.codegen as cg from esphome.components import esp32, light from esphome.components.const import CONF_USE_PSRAM -from esphome.components.esp32 import include_idf_component +from esphome.components.esp32 import include_builtin_idf_component import esphome.config_validation as cv from esphome.const import ( CONF_CHIPSET, @@ -131,7 +131,7 @@ CONFIG_SCHEMA = cv.All( async def to_code(config): # Re-enable ESP-IDF's RMT driver (excluded by default to save compile time) - include_idf_component("esp_driver_rmt") + include_builtin_idf_component("esp_driver_rmt") var = cg.new_Pvariable(config[CONF_OUTPUT_ID]) await light.register_light(var, config) diff --git a/esphome/components/esp32_touch/__init__.py b/esphome/components/esp32_touch/__init__.py index f36a1171b7..6accb89c35 100644 --- a/esphome/components/esp32_touch/__init__.py +++ b/esphome/components/esp32_touch/__init__.py @@ -6,7 +6,7 @@ from esphome.components.esp32 import ( VARIANT_ESP32S3, get_esp32_variant, gpio, - include_idf_component, + include_builtin_idf_component, ) import esphome.config_validation as cv from esphome.const import ( @@ -268,7 +268,7 @@ CONFIG_SCHEMA = cv.All( async def to_code(config): # Re-enable ESP-IDF's touch sensor driver (excluded by default to save compile time) - include_idf_component("esp_driver_touch_sens") + include_builtin_idf_component("esp_driver_touch_sens") touch = cg.new_Pvariable(config[CONF_ID]) await cg.register_component(touch, config) diff --git a/esphome/components/ethernet/__init__.py b/esphome/components/ethernet/__init__.py index aaba12b6d1..8d4a1aaf8e 100644 --- a/esphome/components/ethernet/__init__.py +++ b/esphome/components/ethernet/__init__.py @@ -14,7 +14,7 @@ from esphome.components.esp32 import ( add_idf_component, add_idf_sdkconfig_option, get_esp32_variant, - include_idf_component, + include_builtin_idf_component, ) from esphome.components.network import ip_address_literal from esphome.components.spi import CONF_INTERFACE_INDEX, get_spi_interface @@ -421,7 +421,7 @@ async def to_code(config): add_idf_sdkconfig_option("CONFIG_SW_COEXIST_ENABLE", False) # Re-enable ESP-IDF's Ethernet driver (excluded by default to save compile time) - include_idf_component("esp_eth") + include_builtin_idf_component("esp_eth") if config[CONF_TYPE] == "LAN8670": # Add LAN867x 10BASE-T1S PHY support component diff --git a/esphome/components/http_request/__init__.py b/esphome/components/http_request/__init__.py index eeed2dd411..64d74323d6 100644 --- a/esphome/components/http_request/__init__.py +++ b/esphome/components/http_request/__init__.py @@ -156,7 +156,7 @@ async def to_code(config): if CORE.is_esp32: # Re-enable ESP-IDF's HTTP client (excluded by default to save compile time) - esp32.include_idf_component("esp_http_client") + esp32.include_builtin_idf_component("esp_http_client") cg.add(var.set_buffer_size_rx(config[CONF_BUFFER_SIZE_RX])) cg.add(var.set_buffer_size_tx(config[CONF_BUFFER_SIZE_TX])) diff --git a/esphome/components/i2s_audio/__init__.py b/esphome/components/i2s_audio/__init__.py index df7c464364..1cd2e97a5e 100644 --- a/esphome/components/i2s_audio/__init__.py +++ b/esphome/components/i2s_audio/__init__.py @@ -3,7 +3,7 @@ import esphome.codegen as cg from esphome.components.esp32 import ( add_idf_sdkconfig_option, get_esp32_variant, - include_idf_component, + include_builtin_idf_component, ) from esphome.components.esp32.const import ( VARIANT_ESP32, @@ -277,7 +277,7 @@ async def to_code(config): await cg.register_component(var, config) # Re-enable ESP-IDF's I2S driver (excluded by default to save compile time) - include_idf_component("esp_driver_i2s") + include_builtin_idf_component("esp_driver_i2s") if use_legacy(): cg.add_define("USE_I2S_LEGACY") diff --git a/esphome/components/mqtt/__init__.py b/esphome/components/mqtt/__init__.py index db49a7c6c3..fe153fedfa 100644 --- a/esphome/components/mqtt/__init__.py +++ b/esphome/components/mqtt/__init__.py @@ -4,7 +4,10 @@ from esphome import automation from esphome.automation import Condition import esphome.codegen as cg from esphome.components import logger, socket -from esphome.components.esp32 import add_idf_sdkconfig_option, include_idf_component +from esphome.components.esp32 import ( + add_idf_sdkconfig_option, + include_builtin_idf_component, +) from esphome.config_helpers import filter_source_files_from_platform import esphome.config_validation as cv from esphome.const import ( @@ -361,7 +364,7 @@ async def to_code(config): if CORE.is_esp32: socket.require_wake_loop_threadsafe() # Re-enable ESP-IDF's mqtt component (excluded by default to save compile time) - include_idf_component("mqtt") + include_builtin_idf_component("mqtt") cg.add_define("USE_MQTT") cg.add_global(mqtt_ns.using) diff --git a/esphome/components/neopixelbus/light.py b/esphome/components/neopixelbus/light.py index 7e3de1df15..104762c69e 100644 --- a/esphome/components/neopixelbus/light.py +++ b/esphome/components/neopixelbus/light.py @@ -5,7 +5,7 @@ from esphome.components.esp32 import ( VARIANT_ESP32C3, VARIANT_ESP32S3, get_esp32_variant, - include_idf_component, + include_builtin_idf_component, ) import esphome.config_validation as cv from esphome.const import ( @@ -212,7 +212,7 @@ async def to_code(config): # Re-enable ESP-IDF's RMT driver if using RMT method (excluded by default) if CORE.is_esp32 and method[CONF_TYPE] == METHOD_ESP32_RMT: - include_idf_component("esp_driver_rmt") + include_builtin_idf_component("esp_driver_rmt") method_template = METHODS[method[CONF_TYPE]].to_code( method, config[CONF_VARIANT], config[CONF_INVERT] diff --git a/esphome/components/nextion/display.py b/esphome/components/nextion/display.py index bf22f7dd5f..3bfcc95995 100644 --- a/esphome/components/nextion/display.py +++ b/esphome/components/nextion/display.py @@ -178,7 +178,7 @@ async def to_code(config): cg.add(var.set_tft_url(config[CONF_TFT_URL])) if CORE.is_esp32: # Re-enable ESP-IDF's HTTP client (excluded by default to save compile time) - esp32.include_idf_component("esp_http_client") + esp32.include_builtin_idf_component("esp_http_client") esp32.add_idf_sdkconfig_option("CONFIG_ESP_TLS_INSECURE", True) esp32.add_idf_sdkconfig_option( "CONFIG_ESP_TLS_SKIP_SERVER_CERT_VERIFY", True diff --git a/esphome/components/remote_receiver/__init__.py b/esphome/components/remote_receiver/__init__.py index 7d0634714c..b3dc213c5f 100644 --- a/esphome/components/remote_receiver/__init__.py +++ b/esphome/components/remote_receiver/__init__.py @@ -171,7 +171,7 @@ async def to_code(config): pin = await cg.gpio_pin_expression(config[CONF_PIN]) if CORE.is_esp32: # Re-enable ESP-IDF's RMT driver (excluded by default to save compile time) - esp32.include_idf_component("esp_driver_rmt") + esp32.include_builtin_idf_component("esp_driver_rmt") var = cg.new_Pvariable(config[CONF_ID], pin) cg.add(var.set_rmt_symbols(config[CONF_RMT_SYMBOLS])) diff --git a/esphome/components/remote_transmitter/__init__.py b/esphome/components/remote_transmitter/__init__.py index 46f4155234..8383b9dd75 100644 --- a/esphome/components/remote_transmitter/__init__.py +++ b/esphome/components/remote_transmitter/__init__.py @@ -113,7 +113,7 @@ async def to_code(config): pin = await cg.gpio_pin_expression(config[CONF_PIN]) if CORE.is_esp32: # Re-enable ESP-IDF's RMT driver (excluded by default to save compile time) - esp32.include_idf_component("esp_driver_rmt") + esp32.include_builtin_idf_component("esp_driver_rmt") var = cg.new_Pvariable(config[CONF_ID], pin) cg.add(var.set_rmt_symbols(config[CONF_RMT_SYMBOLS])) diff --git a/tests/components/esp32/test.esp32-idf.yaml b/tests/components/esp32/test.esp32-idf.yaml index 8f79d57e54..f80c854de5 100644 --- a/tests/components/esp32/test.esp32-idf.yaml +++ b/tests/components/esp32/test.esp32-idf.yaml @@ -8,7 +8,7 @@ esp32: enable_lwip_bridge_interface: true disable_libc_locks_in_iram: false # Test explicit opt-out of RAM optimization use_full_certificate_bundle: false # Test CMN bundle (default) - include_idf_components: + include_builtin_idf_components: - freertos # Test escape hatch (freertos is always included anyway) disable_debug_stubs: true disable_ocd_aware: true