Discover your Philips Hue base station
This module requires node >=4.0.0
$ git clone [email protected]:jsfi/hue-discover.git
require('./hue-discover')(configuration);
let bridges = require('./hue-discover')();
// returns array with IP-addresses of available hue bridges
{
timeout: 45000,
bridges: 1,
find: 'meethue.com'
}
default: 45000
(45s)
This option configures the maximal amount of time the function will search the network for bridges.
default: 1
This option configures the quantity of bridges you expect in the network. If the quantity is found the function will return before the timeout ends.
default: 'meethue.com'
This option configures the string that is searched inside the description. If it is found, the IP will be added to the result array.
[ IP1, ... ]
The function returns an array with all the bridges that were found in the network during the time configured in the timeout. If the number of found bridges matches the configured number, the function will return early.