This is the forum archive of Homey. For more information about Homey, visit the Official Homey website.

The Homey Community has been moved to https://community.athom.com.

This forum is now read-only for archive purposes.
Closed

API documentation examples for api are incorrect


I had some minor frustration with the Developer documentation.
Just wanted to list it here so others can benefit:
https://developers.athom.com/api/
Homey.manager( 'api' )

The examples here show the url as `/managers/<manager>` it should be: /manager/<manager> without the `S`.
Also they do not comply to the signature of the function.
The given example will log just null iso the coordinates as the first param is error.
E.g.
Homey.manager('api').get('/managers/geolocation/', function( result ){
Homey.log( result );
});
Should be:
Homey.manager('api').get('/manager/geolocation/', function( err, result ){
Homey.log( result );
});








Comments

  • Also the example for speech-output should be a POST iso a GET.
  • In the buienradar app (https://github.com/athombv/nl.buienradar/blob/master/app.js) there is the following code used:

            Homey.manager('geolocation').on('location', function (location) {            Homey.log( location );            lat = location.latitude;            lon = location.longitude;        } )

    But is never documented.
    Since .on is used as a callback when things change my guess is that this function is called when the location in Homey changes?
  • The API is bound to change even more.
    It frustrated me so I just wanted to write it down for others to find.  :)
  • Looks like a nice way to help each other
This discussion has been closed.