diff --git a/smartapps/smartthings/hue-connect.src/hue-connect.groovy b/smartapps/smartthings/hue-connect.src/hue-connect.groovy index b8d3f54..048390f 100644 --- a/smartapps/smartthings/hue-connect.src/hue-connect.groovy +++ b/smartapps/smartthings/hue-connect.src/hue-connect.groovy @@ -455,7 +455,7 @@ def locationHandler(evt) { log.error "/description.xml returned a bridge that didn't exist" } } - } else if(headerString?.contains("json")) { + } else if(headerString?.contains("json") && isValidSource(parsedEvent.mac)) { log.trace "description.xml response (application/json)" def body = new groovy.json.JsonSlurper().parseText(parsedEvent.body) if (body.success != null) { @@ -494,6 +494,11 @@ def doDeviceSync(){ discoverBridges() } +def isValidSource(macAddress) { + def vbridges = getVerifiedHueBridges() + return (vbridges?.find {"${it.value.mac}" == macAddress}) != null +} + ///////////////////////////////////// //CHILD DEVICE METHODS /////////////////////////////////////