summaryrefslogtreecommitdiff
path: root/google_assistant.py
diff options
context:
space:
mode:
authorScott <[email protected]>2022-01-31 21:38:46 -0800
committerScott <[email protected]>2022-01-31 21:38:46 -0800
commit9eba12cba5641d6a0b988038694cbc2dd52800c5 (patch)
tree450a3274655a3f07e33917db4812792c0a025952 /google_assistant.py
parente224aee343a337beefc61acdfa263c88f0bde312 (diff)
Myre mypy fixes.
Diffstat (limited to 'google_assistant.py')
-rw-r--r--google_assistant.py6
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"])