Made weather agent dependent on user location

I'm not sure if this is the best way to do it... I have zero experience with huginn and haven't written much production Ruby. So feel free to make suggestions for improvements.
Sure thing! I don't mind waiting =)

On Sun, Nov 2, 2014 at 7:44 PM, Andrew Cantino <notifications@github.com>
wrote:

> In app/models/agents/weather_agent.rb:
>
> > @@ -75,12 +76,22 @@ def service
> >        interpolated["service"].presence || "wunderground"
> >      end
> >
> > +    def receive(incoming_events)
> > +      incoming_events.each do |event|
> > +        store_location(event.location.latlng)
> > +      end
> > +    end
> > +
> > +    def store_location(location)
> > +      memory['location'] = location
>
> I wonder if we should just do options['location'] = location? Then it
> would update it's options when it receives an event.
>
> However, I still feel like a new Huginn user would expect the
> WeatherAgent, when receiving events, to immediately emit new events with
> the weather for that location, not reconfigure itself. So, I think this new
> behavior would be a bit surprising for them. Maybe I can try my hand at a
> ConfigurationAgent that reaches into other Agents and changes their
> configurations? You could use this instead. Give me a little bit ;)
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/cantino/huginn/pull/584/files#r19713825>.
>



-- 
Chris Eidhof