Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Location regex/adapt intent wont work #168

Open
emphasize opened this issue Jun 23, 2021 · 3 comments
Open

Location regex/adapt intent wont work #168

emphasize opened this issue Jun 23, 2021 · 3 comments
Assignees
Labels

Comments

@emphasize
Copy link
Contributor

emphasize commented Jun 23, 2021

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 emphasize added the bug label Jun 23, 2021
@emphasize
Copy link
Contributor Author

emphasize commented Jun 23, 2021

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
Copy link
Contributor Author

emphasize commented Jul 31, 2021

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
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants