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.
The Homey Community has been moved to https://community.athom.com.
This forum is now read-only for archive purposes.
Closed
Promise API
Since Homey is currently using 0.12.9 which already supports promises and there is an upcoming upgrade to node 4 which is a LTS release.
I strongly suggest to switch to promises API.
That brings us developer friendly API.
With an upcoming ES7 await we could do even better.
I strongly suggest to switch to promises API.
That brings us developer friendly API.
Homey.manager('cloud').getLocalAddress().then(function(address) { // say my address }).catch(function (err) { // handle error })
With an upcoming ES7 await we could do even better.
async function searchYouTube() { var results = await Homey.manager('api').get('/app/com.youtube/search?q=hello') Homey.log(results) }
This discussion has been closed.
Comments