diff --git a/esphome/components/esp32/__init__.py b/esphome/components/esp32/__init__.py index b1bbd5919e..9f08aaa249 100644 --- a/esphome/components/esp32/__init__.py +++ b/esphome/components/esp32/__init__.py @@ -223,6 +223,7 @@ ARDUINO_LIBRARY_IDF_COMPONENTS: dict[str, tuple[str, ...]] = { # ESPHome uses ESP-IDF APIs directly; we only need the Arduino core # (HardwareSerial, Print, Stream, GPIO functions which are always compiled) # Components can call enable_arduino_library() to re-enable any they need +# This list must match ARDUINO_ALL_LIBRARIES from arduino-esp32/CMakeLists.txt ARDUINO_DISABLED_LIBRARIES = ( "ArduinoOTA", "AsyncUDP", @@ -230,13 +231,17 @@ ARDUINO_DISABLED_LIBRARIES = ( "BluetoothSerial", "DNSServer", "EEPROM", - "ESPmDNS", + "ESP_HostedOTA", + "ESP_I2S", + "ESP_NOW", "ESP_SR", + "ESPmDNS", "Ethernet", "FFat", "FS", "Hash", "HTTPClient", + "HTTPUpdate", "Insights", "LittleFS", "Matter", @@ -254,6 +259,7 @@ ARDUINO_DISABLED_LIBRARIES = ( "SPIFFS", "Ticker", "Update", + "USB", "WebServer", "WiFi", "WiFiProv", diff --git a/esphome/components/espnow/__init__.py b/esphome/components/espnow/__init__.py index 1f5ca1104a..50869acf9b 100644 --- a/esphome/components/espnow/__init__.py +++ b/esphome/components/espnow/__init__.py @@ -124,7 +124,9 @@ async def to_code(config): var = cg.new_Pvariable(config[CONF_ID]) await cg.register_component(var, config) - if CORE.using_arduino: + # ESP32 with Arduino framework uses ESP-IDF APIs directly for ESP-NOW, + # so we don't need the Arduino WiFi library + if CORE.using_arduino and not CORE.is_esp32: cg.add_library("WiFi", None) # ESP-NOW uses wake_loop_threadsafe() to wake the main loop from ESP-NOW callbacks diff --git a/esphome/components/ethernet/__init__.py b/esphome/components/ethernet/__init__.py index 8d4a1aaf8e..0a100c3c78 100644 --- a/esphome/components/ethernet/__init__.py +++ b/esphome/components/ethernet/__init__.py @@ -427,7 +427,9 @@ async def to_code(config): # Add LAN867x 10BASE-T1S PHY support component add_idf_component(name="espressif/lan867x", ref="2.0.0") - if CORE.using_arduino: + # ESP32 with Arduino framework uses ESP-IDF APIs directly for ethernet, + # so we don't need the Arduino WiFi library + if CORE.using_arduino and not CORE.is_esp32: cg.add_library("WiFi", None) CORE.add_job(final_step) diff --git a/esphome/components/web_server_base/__init__.py b/esphome/components/web_server_base/__init__.py index 6c756575d4..97cca5776b 100644 --- a/esphome/components/web_server_base/__init__.py +++ b/esphome/components/web_server_base/__init__.py @@ -38,11 +38,8 @@ async def to_code(config): cg.add_define("WEB_SERVER_DEFAULT_HEADERS_COUNT", 1) return + # ESP32 uses IDF web server (early return above), so this is for other Arduino platforms if CORE.using_arduino: - if CORE.is_esp32: - cg.add_library("WiFi", None) - cg.add_library("FS", None) - cg.add_library("Update", None) if CORE.is_esp8266: cg.add_library("ESP8266WiFi", None) if CORE.is_libretiny: