MycroftAI / skill-weather

Mycroft AI official Weather Skill, providing weather conditions and forecasts.
https://mycroft.ai/skills
Apache License 2.0
19 stars 59 forks source link

Location regex/adapt intent wont work #168

Open emphasize opened 3 years ago

emphasize commented 3 years ago

UPDATE

This is just a typo,

instead of self.location = message.data.get("location") it has to be self.location = message.data.get("Location")

+ L 
- l

The optionally location lookup wont work with this call

emphasize commented 3 years ago

That said, this has revealed another problem

Traceback (most recent call last):
  File "/home/sweng/mycroft-core/mycroft/skills/mycroft_skill/event_container.py", line 73, in wrapper
    handler(message)
  File "/opt/mycroft/skills/skill-weather.emphasize/__init__.py", line 565, in handle_sunset
    dialog.build_sunset_dialog()
  File "/opt/mycroft/skills/skill-weather.emphasize/skill/dialog.py", line 170, in build_sunset_dialog
    now = now_local(tz=self.intent_data.geolocation["timezone"])
  File "/home/sweng/mycroft-core/mycroft/util/time.py", line 68, in now_local
    return datetime.now(tz)
TypeError: tzinfo argument must be None or of a tzinfo subclass, not type 'str'

=> now = now_local(tz=get_tz_info(self.intent_data.geolocation["timezone"]))

emphasize commented 3 years ago

This is indeed a Typo, but in __init___.py

Several intents (condition/storm/rain/...) have .optionally("Location") in their constructor while others go with .optionally("location").

if you issue a condition request with a location information the location on the message object isn't processed correctly since self.location = message.data.get("location") #

chrisveilleux commented 3 years ago

I believe this issue to be resolved. Can you confirm @emphasize?