Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor (options = {}) {
this._debug = debug('HueClient' + ++id)
this._debug('constructor(%j)', options)
this._options = {
hostname: 'localhost',
port: 80,
timeout: 5
}
const optionParser = new homebridgeLib.OptionParser(this._options)
optionParser.stringKey('bridgeid', true)
optionParser.hostKey()
optionParser.stringKey('fingerprint', true)
optionParser.boolKey('phoscon')
optionParser.stringKey('username', true)
optionParser.intKey('timeout', 1, 60)
optionParser.parse(options)
if (this._options.fingerprint != null) {
this._options.https = true
}
this._options.url = this._options.https ? 'https://' : 'http://'
this._options.url += this._options.hostname
if (this._options.port !== 80) {
this._options.url += ':' + this._options.port
}
this._debug('constructor() => %j', this._options)
constructor (options = {}) {
this._debug = debug('HueDiscovery' + ++id)
this._debug('constructor(%j)', options)
this._options = {
timeout: 5
}
const optionParser = new homebridgeLib.OptionParser(this._options)
optionParser.boolKey('verbose')
optionParser.intKey('timeout', 1, 60)
optionParser.parse(options)
this._debug('constructor(%j) => %j', options, this._options)
}