From aec4e27bb66af1f2999272bd0884bea511b0bd8b Mon Sep 17 00:00:00 2001 From: RGBCube Date: Wed, 3 Jan 2024 15:50:58 +0300 Subject: [PATCH] Fix bugs --- rpid/main.py | 6 +++--- rpid/pyproject.toml | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/rpid/main.py b/rpid/main.py index f8af2a9..23511ba 100644 --- a/rpid/main.py +++ b/rpid/main.py @@ -10,10 +10,10 @@ leds = [ (19, True), ] -for led in leds: +for led in leds[1::]: gpio.setmode(gpio.BCM) gpio.setup(led[0], gpio.OUT) - gpio.output(LED_PIN, int(led[1])) + gpio.output(led[0], int(led[1])) app = FastAPI() @@ -39,7 +39,7 @@ async def toggle(number: int) -> str: @app.get("/speak") async def speak(text: str) -> str: - ret = os.system(f'gtts-cli "{text}" --output text.mp3; pw-play text.mp3') + ret = os.system(f'gtts-cli "{text}" --lang tr --output text.mp3; pw-play text.mp3') return f"TEXT {'OK' if ret == 0 else 'FAIL'}, TEXT: {text}"; diff --git a/rpid/pyproject.toml b/rpid/pyproject.toml index 7b7bfc9..ec65685 100644 --- a/rpid/pyproject.toml +++ b/rpid/pyproject.toml @@ -8,5 +8,6 @@ authors = [ "RGBCube" ] python = "^3.8" fastapi = "0.105.0" +gtts = "2.5.0" "RPi.GPIO" = "0.7.1" uvicorn = "0.24.0.post1"