X-Git-Url: https://wannabe.guru.org/gitweb/?a=blobdiff_plain;f=google_assistant.py;fp=google_assistant.py;h=041648ca4f15e9db4ce1b1df2862d948ec450325;hb=b454ad295eb3024a238d32bf2aef1ebc3c496b44;hp=572b4ccdf25644992f77f66eae800ea9e306ce50;hpb=d2478310649d51e14f8ece57651ca9d925d98793;p=python_utils.git diff --git a/google_assistant.py b/google_assistant.py index 572b4cc..041648c 100644 --- a/google_assistant.py +++ b/google_assistant.py @@ -3,6 +3,7 @@ import logging from typing import NamedTuple import sys +import warnings import requests import speech_recognition as sr # type: ignore @@ -93,7 +94,9 @@ def ask_google(cmd: str, *, recognize_speech=True) -> GoogleResponse: logger.debug(f"Transcription: '{audio_transcription}'") except sr.UnknownValueError as e: logger.exception(e) - logger.warning('Unable to parse Google assistant\'s response.') + msg = 'Unable to parse Google assistant\'s response.' + logger.warning(msg) + warnings.warn(msg) audio_transcription = None return GoogleResponse( success=success,