mirror of
https://github.com/esphome/esphome.git
synced 2025-07-29 06:36:45 +00:00
[web_server] Fix download list where external_components has a substitution value (#8911)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
parent
6c08f5e343
commit
fdc6c4a219
@ -601,10 +601,12 @@ class DownloadListRequestHandler(BaseHandler):
|
|||||||
loop = asyncio.get_running_loop()
|
loop = asyncio.get_running_loop()
|
||||||
try:
|
try:
|
||||||
downloads_json = await loop.run_in_executor(None, self._get, configuration)
|
downloads_json = await loop.run_in_executor(None, self._get, configuration)
|
||||||
except vol.Invalid:
|
except vol.Invalid as exc:
|
||||||
|
_LOGGER.exception("Error while fetching downloads", exc_info=exc)
|
||||||
self.send_error(404)
|
self.send_error(404)
|
||||||
return
|
return
|
||||||
if downloads_json is None:
|
if downloads_json is None:
|
||||||
|
_LOGGER.error("Configuration %s not found", configuration)
|
||||||
self.send_error(404)
|
self.send_error(404)
|
||||||
return
|
return
|
||||||
self.set_status(200)
|
self.set_status(200)
|
||||||
@ -618,6 +620,7 @@ class DownloadListRequestHandler(BaseHandler):
|
|||||||
if storage_json is None:
|
if storage_json is None:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
try:
|
||||||
config = yaml_util.load_yaml(settings.rel_path(configuration))
|
config = yaml_util.load_yaml(settings.rel_path(configuration))
|
||||||
|
|
||||||
if const.CONF_EXTERNAL_COMPONENTS in config:
|
if const.CONF_EXTERNAL_COMPONENTS in config:
|
||||||
@ -626,6 +629,8 @@ class DownloadListRequestHandler(BaseHandler):
|
|||||||
)
|
)
|
||||||
|
|
||||||
do_external_components_pass(config)
|
do_external_components_pass(config)
|
||||||
|
except vol.Invalid:
|
||||||
|
_LOGGER.info("Could not parse `external_components`, skipping")
|
||||||
|
|
||||||
from esphome.components.esp32 import VARIANTS as ESP32_VARIANTS
|
from esphome.components.esp32 import VARIANTS as ESP32_VARIANTS
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user