Avoid trying to load platform that are known to not exist in async_prepare_setup_platform (#114659)

This commit is contained in:
J. Nick Koston 2024-04-02 11:22:40 -10:00 committed by GitHub
parent 9b41e3d124
commit 17da077c74
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -504,6 +504,12 @@ async def async_prepare_setup_platform(
log_error(f"Unable to import the component ({exc}).")
return None
if not integration.platforms_exists((domain,)):
log_error(
f"Platform not found (No module named '{integration.pkg_path}.{domain}')"
)
return None
try:
platform = await integration.async_get_platform(domain)
except ImportError as exc: