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

openweathermap bee: set current weather context #311

Merged
merged 1 commit into from
May 18, 2020
Merged

Conversation

rubiojr
Copy link
Collaborator

@rubiojr rubiojr commented May 18, 2020

This makes it easier to retrieve the current weather from other actions
as long as you have the weather bee running and a chain that periodically
gets the current weather (with the cron bee for example).

Example templates:

"Weather in {{.context.weather.current.Name}}: {{(index .context.weather.current.Weather 0).Description}}, {{.context.weather.current.Main.Temp}} ºC"

Would print something like:

Weather in Barcelona: few clouds, 22.57 ºC

This makes it easier to retrieve the current weather from other actions
as long as you have the weather bee running and a chain that periodically
gets the current weather (with the cron bee for example).

Example templates:

"Weather in {{.context.weather.current.Name}}: {{(index .context.weather.current.Weather 0).Description}}, {{.context.weather.current.Main.Temp}} ºC"

Would print something like:

Weather in Barcelona: few clouds, 22.57 ºC
@muesli muesli merged commit 86804e3 into master May 18, 2020
@rubiojr rubiojr deleted the weather-context branch May 18, 2020 15:06
rubiojr added a commit that referenced this pull request May 18, 2020
Extends #311 by adding support
to store multiple locations in the Bee context, at the expense of making
it a bit more complext to retrieve the info from a template.

Something like:

"Weather in {{(index .context.weather.current 3128760).Name}}: ..."

Where 3128760 is the OpenWeatherMap ID corresponding to one of the
locations stored in the context while retrieving the weather.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants