JDureau / snips-skill-meteo

MIT License
1 stars 7 forks source link

Invalid API key #1

Closed Ultchad closed 1 month ago

Ultchad commented 6 years ago

Bonjour quand je demande la météo pour paris rien ne ce passe avec votre App

Le log du service skill

$ sam service log snips-skill-server

Sep 12 18:46:52 raspberry snips-skill-server[3189]: INFO:snips_skill_server_lib::runner            : [heure][out] ()
^[[CSep 12 18:46:52 raspberry snips-skill-server[3189]: INFO:snips_skill_server_lib::runner            : [heure][out] Joseph:searchWeatherForecast
Sep 12 18:46:52 raspberry snips-skill-server[3189]: INFO:snips_skill_server_lib::runner            : [heure][out] ()
Sep 12 18:46:52 raspberry snips-skill-server[3189]: INFO:snips_skill_server_lib::runner            : [meteo][err] Traceback (most recent call last):
Sep 12 18:46:52 raspberry snips-skill-server[3189]: INFO:snips_skill_server_lib::runner            : [meteo][err]   File "_ctypes/callbacks.c", line 315, in 'calling callback function'
Sep 12 18:46:52 raspberry snips-skill-server[3189]: INFO:snips_skill_server_lib::runner            : [meteo][err]   File "/var/lib/snips/skills/snips-skill-meteo/venv/local/lib/python2.7/site-packages/hermes_python/hermes.py", line 54, in called_with_good_params
Sep 12 18:46:52 raspberry snips-skill-server[3189]: INFO:snips_skill_server_lib::runner            : [meteo][err]     return func(self, *parsed_args)
Sep 12 18:46:52 raspberry snips-skill-server[3189]: INFO:snips_skill_server_lib::runner            : [meteo][err]   File "./action-meteo.py", line 198, in intent_received
Sep 12 18:46:52 raspberry snips-skill-server[3189]: INFO:snips_skill_server_lib::runner            : [meteo][err]     weather_forecast = get_weather_forecast(conf, slots)
Sep 12 18:46:52 raspberry snips-skill-server[3189]: INFO:snips_skill_server_lib::runner            : [meteo][err]   File "./action-meteo.py", line 93, in get_weather_forecast
Sep 12 18:46:52 raspberry snips-skill-server[3189]: INFO:snips_skill_server_lib::runner            : [meteo][err]     return parse_open_weather_map_forecast_response(r_forecast.json(), location, time, conf)
Sep 12 18:46:52 raspberry snips-skill-server[3189]: INFO:snips_skill_server_lib::runner            : [meteo][err]   File "./action-meteo.py", line 160, in parse_open_weather_map_forecast_response
Sep 12 18:46:52 raspberry snips-skill-server[3189]: INFO:snips_skill_server_lib::runner            : [meteo][err]     distances = map(lambda forecast: abs(pytz.utc.localize(fromtimestamp(forecast["dt"]))-date), response["list"])
Sep 12 18:46:52 raspberry snips-skill-server[3189]: INFO:snips_skill_server_lib::runner            : [meteo][err] KeyError: 'list'

En faite response a cette tête la:

{
    "message": "Invalid API key. Please see http://openweathermap.org/faq#error401 for more info.", 
    "cod": 401
}

Si il était possible de faire un retour sur ce genre d'erreur (exemple: "Votre clé API n'est pas valide") étant novice sur snips je ne sais pas encore comment changer le code pour ca

PS: j'ai installer l'assistant via sam et il ne m'a pas demander ma clé API donc L’URL n'est pas valide: [http://api.openweathermap.org/data/2.5/forecast?q=Paris&APPID=&units=metric]()

et merci pour tes APP