diff options
| author | Scott <[email protected]> | 2022-01-31 21:38:46 -0800 |
|---|---|---|
| committer | Scott <[email protected]> | 2022-01-31 21:38:46 -0800 |
| commit | 9eba12cba5641d6a0b988038694cbc2dd52800c5 (patch) | |
| tree | 450a3274655a3f07e33917db4812792c0a025952 /google_assistant.py | |
| parent | e224aee343a337beefc61acdfa263c88f0bde312 (diff) | |
Myre mypy fixes.
Diffstat (limited to 'google_assistant.py')
| -rw-r--r-- | google_assistant.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/google_assistant.py b/google_assistant.py index b92f443..0af4fa9 100644 --- a/google_assistant.py +++ b/google_assistant.py @@ -1,8 +1,8 @@ #!/usr/bin/env python3 import logging -from typing import NamedTuple import sys +from typing import NamedTuple, Optional import warnings import requests @@ -36,7 +36,7 @@ class GoogleResponse(NamedTuple): success: bool response: str audio_url: str - audio_transcription: str + audio_transcription: Optional[str] # None if not available. def __repr__(self): return f""" @@ -67,7 +67,7 @@ def ask_google(cmd: str, *, recognize_speech=True) -> GoogleResponse: success = False response = "" audio = "" - audio_transcription = "" + audio_transcription: Optional[str] = "" if r.status_code == 200: j = r.json() success = bool(j["success"]) |
