[usb_host] Fix ESP-IDF 6.0 compatibility for external USB host component (#14844)

This commit is contained in:
Jonathan Swoboda
2026-03-16 01:09:55 -04:00
committed by GitHub
parent c09edb94c1
commit 1183ef825b
2 changed files with 9 additions and 0 deletions

View File

@@ -4,7 +4,9 @@ from esphome.components.esp32 import (
VARIANT_ESP32P4,
VARIANT_ESP32S2,
VARIANT_ESP32S3,
add_idf_component,
add_idf_sdkconfig_option,
idf_version,
only_on_variant,
)
import esphome.config_validation as cv
@@ -64,6 +66,9 @@ async def register_usb_client(config):
async def to_code(config: ConfigType) -> None:
# IDF 6.0 moved USB host to an external component
if idf_version() >= cv.Version(6, 0, 0):
add_idf_component(name="espressif/usb", ref="1.3.0")
add_idf_sdkconfig_option("CONFIG_USB_HOST_CONTROL_TRANSFER_MAX_SIZE", 1024)
if config.get(CONF_ENABLE_HUBS):
add_idf_sdkconfig_option("CONFIG_USB_HOST_HUBS_SUPPORTED", True)

View File

@@ -43,5 +43,9 @@ dependencies:
version: "1.0.0"
rules:
- if: "idf_version >=6.0.0"
espressif/usb:
version: "1.3.0"
rules:
- if: "idf_version >=6.0.0 && target in [esp32s2, esp32s3, esp32p4]"
esp32async/asynctcp:
version: 3.4.91