refactor: Update build_component_and_get_results function to handle custom components and base components separately
This commit is contained in:
parent
6e7a5fa7bd
commit
2affde4dbf
1 changed files with 2 additions and 2 deletions
|
|
@ -66,9 +66,9 @@ async def build_component_and_get_results(
|
||||||
)
|
)
|
||||||
with warnings.catch_warnings():
|
with warnings.catch_warnings():
|
||||||
warnings.filterwarnings("ignore", category=PydanticDeprecatedSince20)
|
warnings.filterwarnings("ignore", category=PydanticDeprecatedSince20)
|
||||||
if base_type == "custom_components":
|
if base_type == "custom_components" and isinstance(custom_component, CustomComponent):
|
||||||
return await build_custom_component(params=params_copy, custom_component=custom_component)
|
return await build_custom_component(params=params_copy, custom_component=custom_component)
|
||||||
elif base_type == "component":
|
elif base_type == "component" and isinstance(custom_component, Component):
|
||||||
return await build_component(params=params_copy, custom_component=custom_component)
|
return await build_component(params=params_copy, custom_component=custom_component)
|
||||||
else:
|
else:
|
||||||
raise ValueError(f"Base type {base_type} not found.")
|
raise ValueError(f"Base type {base_type} not found.")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue