From 7e0970e9173c4cdaeb23f7d0e95dfd8a2c0fb0c1 Mon Sep 17 00:00:00 2001 From: HarvsG <11440490+HarvsG@users.noreply.github.com> Date: Fri, 19 Jul 2024 19:43:38 +0100 Subject: [PATCH] Log timeouts for `assist_pipeline` end of speech detection (#122182) * log timeouts * import logger the right way --- homeassistant/components/assist_pipeline/vad.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/homeassistant/components/assist_pipeline/vad.py b/homeassistant/components/assist_pipeline/vad.py index 6dacd2ff8e9..5b3d1408f58 100644 --- a/homeassistant/components/assist_pipeline/vad.py +++ b/homeassistant/components/assist_pipeline/vad.py @@ -6,8 +6,11 @@ from abc import ABC, abstractmethod from collections.abc import Iterable from dataclasses import dataclass from enum import StrEnum +import logging from typing import Final, cast +_LOGGER = logging.getLogger(__name__) + _SAMPLE_RATE: Final = 16000 # Hz _SAMPLE_WIDTH: Final = 2 # bytes @@ -159,6 +162,10 @@ class VoiceCommandSegmenter: """ self._timeout_seconds_left -= chunk_seconds if self._timeout_seconds_left <= 0: + _LOGGER.warning( + "VAD end of speech detection timed out after %s seconds", + self.timeout_seconds, + ) self.reset() return False