netbeast / api

:rocket: Node.js wrapper for the resources Netbeast Router HTTP API.
http://netbeast.co
11 stars 7 forks source link

netbeast.get returns a response, not a device state #20

Open timonreinhard opened 8 years ago

timonreinhard commented 8 years ago

The README.md gives an example on how to gather data about devices, which looks awesomely simple and straight forward:

beast('temperature').at('kitchen').get().then(function (data) {
    console.log('The temperature in the kitchen is ' + data + 'ºC')
})

The Promise is however fulfilled with a Response rather than the actual data. Same goes for calling get('temperature') as the argument is unused in the code. So for some reason the docs are quite different from the actual implemenation.

┆Issue is synchronized with this Asana task

jsdario commented 8 years ago

Hi @timonreinhard! Yes you are right, there has been some hard refactoring during the latest weeks of development and the devices should be returning data directly, rather than the response. You can easily work around that, though.

About the args, you are right. It seems that you are always going to receive all params from the device, since the query remains unsent. It is also due to our refactor towards a diferent API structure. If you review past versions of the code, it may make more sense.

Since the project is now bigger I beg you a little bit of patience for updates. Also if you are so kind you can create a PR yourself. That'll be more than welcome :)

timonreinhard commented 8 years ago

Great to hear about those things to come as I actually really like the ideas behind Netbeast. I'll dig deeper now and look forward in contributing.

jsdario commented 8 years ago

Thanks. It is always nice to hear. If you have a project to share consider joining also the forum :)