Home Assistant Unofficial Reference 2024.12.1
const.py
Go to the documentation of this file.
1 """Constants for the Assist pipeline integration."""
2 
3 DOMAIN = "assist_pipeline"
4 
5 DATA_CONFIG = f"{DOMAIN}.config"
6 DATA_MIGRATIONS = f"{DOMAIN}_migrations"
7 
8 DEFAULT_PIPELINE_TIMEOUT = 60 * 5 # seconds
9 
10 DEFAULT_WAKE_WORD_TIMEOUT = 3 # seconds
11 
12 CONF_DEBUG_RECORDING_DIR = "debug_recording_dir"
13 
14 DATA_LAST_WAKE_UP = f"{DOMAIN}.last_wake_up"
15 WAKE_WORD_COOLDOWN = 2 # seconds
16 
17 EVENT_RECORDING = f"{DOMAIN}_recording"
18 
19 SAMPLE_RATE = 16000 # hertz
20 SAMPLE_WIDTH = 2 # bytes
21 SAMPLE_CHANNELS = 1 # mono
22 MS_PER_CHUNK = 10
23 SAMPLES_PER_CHUNK = SAMPLE_RATE // (1000 // MS_PER_CHUNK) # 10 ms @ 16Khz
24 BYTES_PER_CHUNK = SAMPLES_PER_CHUNK * SAMPLE_WIDTH * SAMPLE_CHANNELS # 16-bit
25 
26 OPTION_PREFERRED = "preferred"