hass-core/homeassistant/components/assist_pipeline/error.py
Michael Hansen 7ea2998b55
Add wake word integration (#96380)
* Add wake component

* Add wake support to Wyoming

* Add helper function to assist_pipeline (not complete)

* Rename wake to wake_word

* Fix platform

* Use send_event and clean up

* Merge wake word into pipeline

* Add wake option to async_pipeline_from_audio_stream

* Add start/end stages to async_pipeline_from_audio_stream

* Add wake timeout

* Remove layer in wake_output

* Use VAD for wake word timeout

* Include audio metadata in wake-start

* Remove unnecessary websocket command

* wake -> wake_word

* Incorporate feedback

* Clean up wake_word tests

* Add wyoming wake word tests

* Add pipeline wake word test

* Add last processed state

* Fix tests

* Add tests for wake word

* More tests for the codebot
2023-08-07 22:22:16 -04:00

38 lines
987 B
Python

"""Assist pipeline errors."""
from homeassistant.exceptions import HomeAssistantError
class PipelineError(HomeAssistantError):
"""Base class for pipeline errors."""
def __init__(self, code: str, message: str) -> None:
"""Set error message."""
self.code = code
self.message = message
super().__init__(f"Pipeline error code={code}, message={message}")
class PipelineNotFound(PipelineError):
"""Unspecified pipeline picked."""
class WakeWordDetectionError(PipelineError):
"""Error in wake-word-detection portion of pipeline."""
class WakeWordTimeoutError(WakeWordDetectionError):
"""Timeout when wake word was not detected."""
class SpeechToTextError(PipelineError):
"""Error in speech-to-text portion of pipeline."""
class IntentRecognitionError(PipelineError):
"""Error in intent recognition portion of pipeline."""
class TextToSpeechError(PipelineError):
"""Error in text-to-speech portion of pipeline."""