[core] Remove deprecated custom_components folder loading (#16679)
This commit is contained in:
1 parent
62b3b1cc75
commit
4d908798bc
3 files changed
+2
-16
No files matched your search
@@ -1005,7 +1005,6 @@ def validate_config(
|
|||||||
CORE.skip_external_update = skip_external_update
|
CORE.skip_external_update = skip_external_update
|
||||||
|
|
||||||
loader.clear_component_meta_finders()
|
loader.clear_component_meta_finders()
|
||||||
loader.install_custom_components_meta_finder()
|
|
||||||
|
|
||||||
# 0. Load packages
|
# 0. Load packages
|
||||||
if CONF_PACKAGES in config:
|
if CONF_PACKAGES in config:
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ from types import ModuleType
|
|||||||
from typing import TYPE_CHECKING, Any
|
from typing import TYPE_CHECKING, Any
|
||||||
|
|
||||||
from esphome.const import SOURCE_FILE_EXTENSIONS
|
from esphome.const import SOURCE_FILE_EXTENSIONS
|
||||||
from esphome.core import CORE
|
|
||||||
from esphome.types import ConfigType
|
from esphome.types import ConfigType
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
@@ -206,18 +205,6 @@ def install_meta_finder(
|
|||||||
sys.meta_path.insert(0, ComponentMetaFinder(components_path, allowed_components))
|
sys.meta_path.insert(0, ComponentMetaFinder(components_path, allowed_components))
|
||||||
|
|
||||||
|
|
||||||
def install_custom_components_meta_finder():
|
|
||||||
# Remove before 2026.6.0
|
|
||||||
custom_components_dir = (Path(CORE.config_dir) / "custom_components").resolve()
|
|
||||||
if custom_components_dir.is_dir() and any(custom_components_dir.iterdir()):
|
|
||||||
_LOGGER.warning(
|
|
||||||
"The 'custom_components' folder is deprecated and will be removed in 2026.6.0. "
|
|
||||||
"Please use 'external_components' instead. "
|
|
||||||
"See https://esphome.io/components/external_components.html for more information."
|
|
||||||
)
|
|
||||||
install_meta_finder(custom_components_dir)
|
|
||||||
|
|
||||||
|
|
||||||
def _lookup_module(domain: str, exception: bool) -> ComponentManifest | None:
|
def _lookup_module(domain: str, exception: bool) -> ComponentManifest | None:
|
||||||
if domain in _COMPONENT_CACHE:
|
if domain in _COMPONENT_CACHE:
|
||||||
return _COMPONENT_CACHE[domain]
|
return _COMPONENT_CACHE[domain]
|
||||||
|
|||||||
+2
-2
@@ -200,8 +200,8 @@ ESPHome automatically populates the build directory, and any
|
|||||||
changes to this directory will be removed the next time esphome is
|
changes to this directory will be removed the next time esphome is
|
||||||
run.
|
run.
|
||||||
|
|
||||||
For modifying esphome's core files, please use a development esphome install,
|
For modifying esphome's core files, please use a development esphome install
|
||||||
the custom_components folder or the external_components feature.
|
or the external_components feature.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user