Closed rubiojr closed 4 years ago
Kinda torn about this one. Makes it possible to retrieve the weather of multiple locations from the context but also makes it uglier to use it from a template.
The alternative would be to create multiple weather bees for each location, which is already supported by the previously merged PR, https://github.com/muesli/beehive/pull/311
I agree: our typical approach here would be to initialize multiple instances of the OpenWeatherMapBee
, unless there are other advantages to sharing a single instance.
Extends https://github.com/muesli/beehive/pull/311 by adding support to store multiple locations in the Bee context, at the expense of making it a bit more complex to retrieve the info from a template.
Something like:
Where
3128760
is the OpenWeatherMap ID corresponding to one of the locations stored in the context while retrieving the weather.