#!/usr/bin/env python3
import logging
-from typing import NamedTuple
import sys
import warnings
+from typing import NamedTuple, Optional
import requests
import speech_recognition as sr # type: ignore
type=str,
default="http://kiosk.house:3000",
metavar="URL",
- help="How to contact the Google Assistant bridge"
+ help="How to contact the Google Assistant bridge",
)
parser.add_argument(
"--google_assistant_username",
type=str,
metavar="GOOGLE_ACCOUNT",
default="scott.gasch",
- help="The user account for talking to Google Assistant"
+ help="The user account for talking to Google Assistant",
)
success: bool
response: str
audio_url: str
- audio_transcription: str
+ audio_transcription: Optional[str] # None if not available.
def __repr__(self):
return f"""
success = False
response = ""
audio = ""
- audio_transcription = ""
+ audio_transcription: Optional[str] = ""
if r.status_code == 200:
j = r.json()
success = bool(j["success"])