Migrate condition/state/trigger helper to use async_get_platform (#112144)

Currently these would always load the platform in the loop
if it was not already loaded
This commit is contained in:
J. Nick Koston
2024-03-03 16:20:47 -10:00
committed by GitHub
parent f1eab3f11f
commit 331989de4c
4 changed files with 7 additions and 4 deletions

View File

@@ -222,7 +222,7 @@ async def _async_get_trigger_platform(
except IntegrationNotFound:
raise vol.Invalid(f"Invalid platform '{platform}' specified") from None
try:
return integration.get_platform("trigger")
return await integration.async_get_platform("trigger")
except ImportError:
raise vol.Invalid(
f"Integration '{platform}' does not provide trigger support"