mirror of
https://github.com/home-assistant/core.git
synced 2025-11-08 02:19:31 +00:00
Simplify get pipeline method (#93865)
This commit is contained in:
@@ -17,6 +17,7 @@ from homeassistant.helpers import config_validation as cv
|
||||
from homeassistant.util import language as language_util
|
||||
|
||||
from .const import DOMAIN
|
||||
from .error import PipelineNotFound
|
||||
from .pipeline import (
|
||||
PipelineData,
|
||||
PipelineError,
|
||||
@@ -85,8 +86,9 @@ async def websocket_run(
|
||||
) -> None:
|
||||
"""Run a pipeline."""
|
||||
pipeline_id = msg.get("pipeline")
|
||||
pipeline = async_get_pipeline(hass, pipeline_id=pipeline_id)
|
||||
if pipeline is None:
|
||||
try:
|
||||
pipeline = async_get_pipeline(hass, pipeline_id=pipeline_id)
|
||||
except PipelineNotFound:
|
||||
connection.send_error(
|
||||
msg["id"],
|
||||
"pipeline-not-found",
|
||||
|
||||
Reference in New Issue
Block a user