mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +00:00
Log timeouts for assist_pipeline
end of speech detection (#122182)
* log timeouts * import logger the right way
This commit is contained in:
parent
e6e748ae0a
commit
7e0970e917
@ -6,8 +6,11 @@ from abc import ABC, abstractmethod
|
|||||||
from collections.abc import Iterable
|
from collections.abc import Iterable
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from enum import StrEnum
|
from enum import StrEnum
|
||||||
|
import logging
|
||||||
from typing import Final, cast
|
from typing import Final, cast
|
||||||
|
|
||||||
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
_SAMPLE_RATE: Final = 16000 # Hz
|
_SAMPLE_RATE: Final = 16000 # Hz
|
||||||
_SAMPLE_WIDTH: Final = 2 # bytes
|
_SAMPLE_WIDTH: Final = 2 # bytes
|
||||||
|
|
||||||
@ -159,6 +162,10 @@ class VoiceCommandSegmenter:
|
|||||||
"""
|
"""
|
||||||
self._timeout_seconds_left -= chunk_seconds
|
self._timeout_seconds_left -= chunk_seconds
|
||||||
if self._timeout_seconds_left <= 0:
|
if self._timeout_seconds_left <= 0:
|
||||||
|
_LOGGER.warning(
|
||||||
|
"VAD end of speech detection timed out after %s seconds",
|
||||||
|
self.timeout_seconds,
|
||||||
|
)
|
||||||
self.reset()
|
self.reset()
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user