Wetterabfrage funktoiniert mit deutschen einwörtigen Stadtnamen
This commit is contained in:
11
main.py
11
main.py
@@ -6,6 +6,7 @@ import os
|
||||
import subprocess
|
||||
import sounddevice as sd
|
||||
import re
|
||||
import asyncio
|
||||
|
||||
#test
|
||||
|
||||
@@ -102,9 +103,17 @@ def detect_intent(text):
|
||||
# SKILLS
|
||||
# =========================
|
||||
|
||||
from weather_jetzt import get_weather_for_location
|
||||
|
||||
def weather_skill(slots):
|
||||
location = slots["location"]
|
||||
return f"Das Wetter in {location} ist sonnig bei 20 Grad."
|
||||
result = asyncio.run(get_weather_for_location(location))
|
||||
|
||||
if result:
|
||||
return f"Aktuell sind es in {result['location']} {result['temperatur']} Grad und die Wetterlage sieht {result['wetterlage']} aus."
|
||||
else:
|
||||
return f"Keine Wetterdaten verfügbar"
|
||||
#return f"Das Wetter in {location} ist sonnig bei 20 Grad."
|
||||
|
||||
def timer_skill(slots):
|
||||
duration = slots["duration"]
|
||||
|
||||
Reference in New Issue
Block a user