Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async _nupnp (options) {
if (this._options.verbose) {
this.bridgeMap[options.name] = {}
}
options.timeout = this._options.timeout
const client = new homebridgeLib.RestClient(options)
return client.get().then((response) => {
if (Array.isArray(response)) {
for (const bridge of response) {
let host = bridge.internalipaddress
if (bridge.internalport != null && bridge.internalport !== 80) {
host += ':' + bridge.internalport
}
const id = bridge.id.toUpperCase()
this._debug('%s: found %s at %s', options.name, id, host)
if (this._options.verbose) {
this.bridgeMap[options.name][host] = id
} else {
this.bridgeMap[host] = id
}
}
}