peter-murray / node-hue-api

Node.js Library for interacting with the Philips Hue Bridge and Lights
Apache License 2.0
1.18k stars 145 forks source link

Fix for connectWithTokens & connectWithCode #186

Closed graybright closed 3 years ago

graybright commented 3 years ago

Hello Peter + all the dev's who've helped on this project! This is such a great library, thanks for creating it.

connectWithTokens

I've noticed a slight error in the example code for the connectWithTokens on the remoteBootstrap.md page

Currently displayed as:

const v3 = require('node-hue-api').v3;
const remoteBootstrap = v3.api.createRemote(clientId, clientSecret);
remoteBootstrap.connectWithCode(code) //<<<ERROR IS HERE
  .then(api => {
    // Do something with the api like getting lights etc... 
  })

Possible correction:

const v3 = require('node-hue-api').v3;
const remoteBootstrap = v3.api.createRemote(clientId, clientSecret);
remoteBootstrap.connectWithTokens(code) //<<<CORRECTION IS HERE
  .then(api => {
    // Do something with the api like getting lights etc... 
  })

connectWithCode

Another small correction for this remoteBootstrap.md page is to correct the connectWithCode explanation text as username and remoteBridgeId are currently misspelt. The first line current says: (incorrect) "The connectWithCode(code, useername, timeout, deviceType, remoteBirdgeId) function will ..." (correct) "The connectWithCode(code, username, timeout, deviceType, remoteBridgeId) function will ..."

Thanks again everyone!