Home Assistant Unofficial Reference 2024.12.1
models.py
Go to the documentation of this file.
1 """Wake word models."""
2 
3 from dataclasses import dataclass
4 
5 
6 @dataclass(frozen=True)
7 class WakeWord:
8  """Wake word model."""
9 
10  id: str
11  """Id of wake word model"""
12 
13  name: str
14  """Name of wake word model"""
15 
16  phrase: str | None = None
17  """Wake word phrase used to trigger model"""
18 
19 
20 @dataclass
22  """Result of wake word detection."""
23 
24  wake_word_id: str
25  """Id of detected wake word"""
26 
27  wake_word_phrase: str
28  """Normalized phrase for the detected wake word"""
29 
30  timestamp: int | None
31  """Timestamp of audio chunk with detected wake word"""
32 
33  queued_audio: list[tuple[bytes, int]] | None = None
34  """Audio chunks that were queued when wake word was detected."""