Home Assistant Unofficial Reference 2024.12.1
error.py
Go to the documentation of this file.
1 """Assist pipeline errors."""
2 
3 from homeassistant.exceptions import HomeAssistantError
4 
5 
7  """Base class for pipeline errors."""
8 
9  def __init__(self, code: str, message: str) -> None:
10  """Set error message."""
11  self.codecode = code
12  self.messagemessage = message
13 
14  super().__init__(f"Pipeline error code={code}, message={message}")
15 
16 
18  """Unspecified pipeline picked."""
19 
20 
21 class WakeWordDetectionError(PipelineError):
22  """Error in wake-word-detection portion of pipeline."""
23 
24 
26  """Wake-word-detection was aborted."""
27 
28  def __init__(self) -> None:
29  """Set error message."""
30  super().__init__("wake_word_detection_aborted", "")
31 
32 
34  """Timeout when wake word was not detected."""
35 
36 
37 class SpeechToTextError(PipelineError):
38  """Error in speech-to-text portion of pipeline."""
39 
40 
42  """Error when multiple voice assistants wake up at the same time (same wake word)."""
43 
44  def __init__(self, wake_up_phrase: str) -> None:
45  """Set error message."""
46  super().__init__(
47  "duplicate_wake_up_detected",
48  f"Duplicate wake-up detected for {wake_up_phrase}",
49  )
50 
51 
53  """Error in intent recognition portion of pipeline."""
54 
55 
56 class TextToSpeechError(PipelineError):
57  """Error in text-to-speech portion of pipeline."""
None __init__(self, str code, str message)
Definition: error.py:9