Avoid trying to import platforms that do not exist (#112028)
* Avoid trying to import platforms that do not exist * adjust * fixes * cleanup * cleanup * cleanup * Apply suggestions from code review * docs * fixes * fixes * comment * coverage * coverage * coverage * Switch config to use async_get_component This was another path where integrations that were marked to load in the executor would be loaded in the loop * Switch config to use async_get_component/async_get_platform This was another path where integrations that were marked to load in the executor would be loaded in the loop * merge * refactor * refactor * coverage * preen * preen
This commit is contained in:
parent
a253991c6d
commit
c8cb0ff61d
9 changed files with 135 additions and 16 deletions
|
@ -48,6 +48,10 @@ def _get_platform(
|
|||
)
|
||||
return None
|
||||
|
||||
if integration.platform_exists(platform_name) is False:
|
||||
# If the platform cannot possibly exist, don't bother trying to load it
|
||||
return None
|
||||
|
||||
try:
|
||||
return integration.get_platform(platform_name)
|
||||
except ImportError as err:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue