-
Notifications
You must be signed in to change notification settings - Fork 157
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
Foursquare venue query node and tests (issue #42) #56
Conversation
716b5d9
to
39a85f1
Compare
this.on("input", function(msg) { | ||
if (msg.lat && msg.lon) { | ||
// if data is in the msg input then this overwrites the node settings | ||
if (msg.section && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The conclusion reached in node-red/node-red#399 is that if a property is set in the node, it cannot be overridden by the message. We obviously didn't do a good job communicating that around the team.
I'll review the other web nodes to make sure this is followed elsewhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes, I didn't appreciate that. I followed the behaviour in the weather node and this does the same thing:
//if there is data in the message input, it overwrites the node setting values.
//If the data is erroneous or not there, the values remain the node settings.
(weather.js line 20&21)
@knolleary Are you planning to include @hbeeken 's changes in the upcoming release too? Do you want me to move the location data under msg.location in this pull request as well? It's @hbeeken's work so I'd rather not touch it, especially as I'm not sure if I can somehow add changes on top of this pull request. @hbeeken, depending on what @knolleary does, this pull request might need to be updated so that msg.lat, msg.lon is moved under a location object such as msg.location.lat, msg.location.lon. |
39a85f1
to
d1900b6
Compare
This change now includes both the updates to msg.location.lon/msg/location.lat as well as ensuring any node settings override those sent in the incoming msg. I believe it's ready to be merged. Any updates returning multiple msgs etc. will be done as a separate pull request and build on this one. |
Foursquare venue query node and tests (issue #42)
This node can be merged as it enables the user to explore "food", "outdoor venues" and "sights" near the provided location (lat/lon coordinates). It returns the first recommended venue from the ordered list as determined by Foursquare.
There are of course extensions which can be made (not limiting to 3 categories of venues, not limiting results returned to just the first recommended venue) but these can be done at a later time in other pull requests.
(Part of issue #42)