Refactor integration platforms to import in the executor (#112168)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
This commit is contained in:
parent
a9caa3e582
commit
8b017016b0
7 changed files with 242 additions and 60 deletions
|
@ -1122,6 +1122,10 @@ class Integration:
|
|||
raise self._missing_platforms_cache[full_name]
|
||||
return None
|
||||
|
||||
def get_platform_cached(self, platform_name: str) -> ModuleType | None:
|
||||
"""Return a platform for an integration from cache."""
|
||||
return self._cache.get(f"{self.domain}.{platform_name}") # type: ignore[return-value]
|
||||
|
||||
def get_platform(self, platform_name: str) -> ModuleType:
|
||||
"""Return a platform for an integration."""
|
||||
if platform := self._get_platform_cached_or_raise(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue