Skip to content

ESP32

A component that depends on an esp32: setting asks the esp32 platform for it from its FINAL_VALIDATE_SCHEMA instead of reading the esp32 config itself, so it keeps working when esp32 changes how it stores that setting.

  • esp32.execute_from_psram(): whether execute_from_psram is on under esp32: framework: advanced:.
  • esp32.user_sdkconfig_bool(name): a yes/no option from the user’s esp32: framework: sdkconfig_options:. It returns True for y, False for n (in any case) and None when the user did not set it or set something else, so a check can tell “off” from “left at the ESP-IDF default”.
from esphome.components import esp32
import esphome.config_validation as cv
from esphome.types import ConfigType
CONF_TASK_CORE = "task_core"
def _final_validate(config: ConfigType) -> ConfigType:
if config[CONF_TASK_CORE] == 1 and esp32.user_sdkconfig_bool("CONFIG_FREERTOS_UNICORE"):
raise cv.Invalid("task_core: 1 requires FreeRTOS dual-core mode")
return config
FINAL_VALIDATE_SCHEMA = _final_validate

Both read the full configuration, so they only work during final validation, not in to_code.

They are available in ESPHome 2026.12.0 and later (esphome/esphome#23524, esphome/esphome#23575).