load external component to get get_download_types

This commit is contained in:
Tomasz Duda 2025-01-25 12:14:56 +01:00
parent fc847c1de8
commit 711f320af8

View File

@ -51,7 +51,7 @@ from .util.text import friendly_name_slugify
if TYPE_CHECKING:
from requests import Response
import voluptuous as vol
_LOGGER = logging.getLogger(__name__)
@ -599,6 +599,19 @@ class DownloadListRequestHandler(BaseHandler):
self.send_error(404)
return
config = yaml_util.load_yaml(settings.rel_path(configuration))
if const.CONF_EXTERNAL_COMPONENTS in config:
from esphome.components.external_components import (
do_external_components_pass,
)
try:
do_external_components_pass(config)
except vol.Invalid:
self.send_error(404)
return
from esphome.components.esp32 import VARIANTS as ESP32_VARIANTS
downloads = []