Wetterabfrage funktoiniert mit deutschen einwörtigen Stadtnamen

This commit is contained in:
2026-01-19 00:03:37 +01:00
parent 4a4bd6f286
commit 7e782e7a45
3 changed files with 89 additions and 1 deletions

11
main.py
View File

@@ -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"]