Skip to content

Commit

Permalink
Fixing change in property for UPnP search results to correctly pull b…
Browse files Browse the repository at this point in the history
…ack data from results, fixes #162
  • Loading branch information
peter-murray committed Jan 22, 2020
1 parent 9bb7f07 commit 57619b6
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lib/api/discovery/UPnP.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,14 @@ function _processResults(responses) {
const results = {};

responses.forEach(response => {
const location = response.location
, hueBridgeId = response['hue-bridgeId']
;
const location = response.location;

// Older versions used to use hue-bridgeId, now newer software versions use hue-bridgeid, remove the older fallback
// once they are outdated.
let hueBridgeId = response['hue-bridgeid'];
if (hueBridgeId == undefined) {
hueBridgeId = response['hue-bridgeId'];
}

if (location && hueBridgeId) {
if (!results[location]) {
Expand Down

0 comments on commit 57619b6

Please sign in to comment.