added unit test, updated Readme and picture
This commit is contained in:
@@ -3,16 +3,15 @@ import sys
|
||||
import time
|
||||
from datetime import datetime
|
||||
import subprocess
|
||||
from slovak_datetime_formatter import get_datetime_as_slovak_sentence
|
||||
from lib.slovak_datetime_formatter import get_datetime_as_slovak_sentence
|
||||
|
||||
if len(sys.argv) > 1 and sys.argv[1] == "test":
|
||||
import dummygpio as GPIO
|
||||
import lib.dummygpio as GPIO
|
||||
else:
|
||||
import RPi.GPIO as GPIO
|
||||
|
||||
BUTTON_TIMEOUT = (
|
||||
30 # button release timeout terminates playing
|
||||
)
|
||||
TTS_API_URL = "https://tts.virtonline.eu/api/tts"
|
||||
BUTTON_TIMEOUT = 30 # button release timeout terminates playing
|
||||
PIN = 27 # listen to changes on this GPIO pin
|
||||
GPIO.setmode(GPIO.BCM) # use BCM pin layout
|
||||
GPIO.setwarnings(False)
|
||||
@@ -56,11 +55,16 @@ def generate_presny_cas():
|
||||
username, password = get_credentials()
|
||||
subprocess.call(
|
||||
[
|
||||
"curl", "--silent", "-u", f"{username}:{password}",
|
||||
"curl",
|
||||
"--silent",
|
||||
"-u",
|
||||
f"{username}:{password}",
|
||||
"--get",
|
||||
"--data-urlencode", f"text={text}",
|
||||
"https://tts.virtonline.eu/api/tts",
|
||||
"--output", "presny_cas.wav",
|
||||
"--data-urlencode",
|
||||
f"text={text}",
|
||||
TTS_API_URL,
|
||||
"--output",
|
||||
"presny_cas.wav",
|
||||
]
|
||||
)
|
||||
print("Generated presny_cas.wav")
|
||||
|
||||
Reference in New Issue
Block a user