mirror of
https://github.com/esphome/esphome.git
synced 2026-05-31 17:06:40 +08:00
[esp32] Remove deprecated add_idf_component() parameters and IDF component refresh option (#14105)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -25,7 +25,6 @@ from esphome.const import (
|
|||||||
CONF_PLATFORM_VERSION,
|
CONF_PLATFORM_VERSION,
|
||||||
CONF_PLATFORMIO_OPTIONS,
|
CONF_PLATFORMIO_OPTIONS,
|
||||||
CONF_REF,
|
CONF_REF,
|
||||||
CONF_REFRESH,
|
|
||||||
CONF_SAFE_MODE,
|
CONF_SAFE_MODE,
|
||||||
CONF_SOURCE,
|
CONF_SOURCE,
|
||||||
CONF_TYPE,
|
CONF_TYPE,
|
||||||
@@ -41,7 +40,7 @@ from esphome.const import (
|
|||||||
ThreadModel,
|
ThreadModel,
|
||||||
__version__,
|
__version__,
|
||||||
)
|
)
|
||||||
from esphome.core import CORE, HexInt, TimePeriod
|
from esphome.core import CORE, HexInt
|
||||||
from esphome.coroutine import CoroPriority, coroutine_with_priority
|
from esphome.coroutine import CoroPriority, coroutine_with_priority
|
||||||
import esphome.final_validate as fv
|
import esphome.final_validate as fv
|
||||||
from esphome.helpers import copy_file_if_changed, rmtree, write_file_if_changed
|
from esphome.helpers import copy_file_if_changed, rmtree, write_file_if_changed
|
||||||
@@ -499,36 +498,11 @@ def add_idf_component(
|
|||||||
repo: str | None = None,
|
repo: str | None = None,
|
||||||
ref: str | None = None,
|
ref: str | None = None,
|
||||||
path: str | None = None,
|
path: str | None = None,
|
||||||
refresh: TimePeriod | None = None,
|
|
||||||
components: list[str] | None = None,
|
|
||||||
submodules: list[str] | None = None,
|
|
||||||
):
|
):
|
||||||
"""Add an esp-idf component to the project."""
|
"""Add an esp-idf component to the project."""
|
||||||
if not repo and not ref and not path:
|
if not repo and not ref and not path:
|
||||||
raise ValueError("Requires at least one of repo, ref or path")
|
raise ValueError("Requires at least one of repo, ref or path")
|
||||||
if refresh or submodules or components:
|
|
||||||
_LOGGER.warning(
|
|
||||||
"The refresh, components and submodules parameters in add_idf_component() are "
|
|
||||||
"deprecated and will be removed in ESPHome 2026.1. If you are seeing this, report "
|
|
||||||
"an issue to the external_component author and ask them to update it."
|
|
||||||
)
|
|
||||||
components_registry = CORE.data[KEY_ESP32][KEY_COMPONENTS]
|
components_registry = CORE.data[KEY_ESP32][KEY_COMPONENTS]
|
||||||
if components:
|
|
||||||
for comp in components:
|
|
||||||
existing = components_registry.get(comp)
|
|
||||||
if existing and existing.get(KEY_REF) != ref:
|
|
||||||
_LOGGER.warning(
|
|
||||||
"IDF component %s version conflict %s replaced by %s",
|
|
||||||
comp,
|
|
||||||
existing.get(KEY_REF),
|
|
||||||
ref,
|
|
||||||
)
|
|
||||||
components_registry[comp] = {
|
|
||||||
KEY_REPO: repo,
|
|
||||||
KEY_REF: ref,
|
|
||||||
KEY_PATH: f"{path}/{comp}" if path else comp,
|
|
||||||
}
|
|
||||||
else:
|
|
||||||
existing = components_registry.get(name)
|
existing = components_registry.get(name)
|
||||||
if existing and existing.get(KEY_REF) != ref:
|
if existing and existing.get(KEY_REF) != ref:
|
||||||
_LOGGER.warning(
|
_LOGGER.warning(
|
||||||
@@ -1037,16 +1011,6 @@ def _parse_idf_component(value: str) -> ConfigType:
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def _validate_idf_component(config: ConfigType) -> ConfigType:
|
|
||||||
"""Validate IDF component config and warn about deprecated options."""
|
|
||||||
if CONF_REFRESH in config:
|
|
||||||
_LOGGER.warning(
|
|
||||||
"The 'refresh' option for IDF components is deprecated and has no effect. "
|
|
||||||
"It will be removed in ESPHome 2026.1. Please remove it from your configuration."
|
|
||||||
)
|
|
||||||
return config
|
|
||||||
|
|
||||||
|
|
||||||
FRAMEWORK_ESP_IDF = "esp-idf"
|
FRAMEWORK_ESP_IDF = "esp-idf"
|
||||||
FRAMEWORK_ARDUINO = "arduino"
|
FRAMEWORK_ARDUINO = "arduino"
|
||||||
FRAMEWORK_SCHEMA = cv.Schema(
|
FRAMEWORK_SCHEMA = cv.Schema(
|
||||||
@@ -1135,13 +1099,9 @@ FRAMEWORK_SCHEMA = cv.Schema(
|
|||||||
cv.Optional(CONF_SOURCE): cv.git_ref,
|
cv.Optional(CONF_SOURCE): cv.git_ref,
|
||||||
cv.Optional(CONF_REF): cv.string,
|
cv.Optional(CONF_REF): cv.string,
|
||||||
cv.Optional(CONF_PATH): cv.string,
|
cv.Optional(CONF_PATH): cv.string,
|
||||||
cv.Optional(CONF_REFRESH): cv.All(
|
|
||||||
cv.string, cv.source_refresh
|
|
||||||
),
|
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
_validate_idf_component,
|
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user