mirror of
https://github.com/RGBCube/GDUS
synced 2025-07-28 05:27:45 +00:00
Fixes
This commit is contained in:
parent
e69cec1b40
commit
eb584e3bf1
2 changed files with 3 additions and 2 deletions
|
@ -15,6 +15,7 @@ app = FastAPI()
|
|||
|
||||
@app.get("/led/toggle")
|
||||
async def toggle() -> str:
|
||||
global led_state
|
||||
led_state = not led_state
|
||||
gpio.output(LED_PIN, int(led_state))
|
||||
|
||||
|
@ -22,7 +23,7 @@ async def toggle() -> str:
|
|||
|
||||
@app.get("/speak")
|
||||
async def speak(text: str) -> str:
|
||||
ret = os.system(f'text2speech "{text}""')
|
||||
ret = os.system(f'text2speech "{text}"')
|
||||
|
||||
return f"TEXT {'OK' if ret == 0 else 'FAIL'}, TEXT: {text}";
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ async fn main() -> io::Result<()> {
|
|||
.service(submit::submit_form)
|
||||
.service(view::view)
|
||||
})
|
||||
.bind(("0.0.0.0", 80))?
|
||||
.bind(("0.0.0.0", 8080))?
|
||||
.run()
|
||||
.await
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue