DVCSMP-2004 Philips Hue: Nullpointer in bridge

This commit is contained in:
Lars Finander
2016-09-06 10:43:03 -06:00
parent af2ea04442
commit 5c2e06c98d
2 changed files with 8 additions and 4 deletions

View File

@@ -62,7 +62,7 @@ def parse(description) {
log.trace "HUE BRIDGE, GENERATING EVENT: $map.name: $map.value" log.trace "HUE BRIDGE, GENERATING EVENT: $map.name: $map.value"
results << createEvent(name: "${map.name}", value: "${map.value}") results << createEvent(name: "${map.name}", value: "${map.value}")
} else { } else {
log.trace "Parsing description" log.trace "Parsing description"
def msg = parseLanMessage(description) def msg = parseLanMessage(description)
if (msg.body) { if (msg.body) {
def contentType = msg.headers["Content-Type"] def contentType = msg.headers["Content-Type"]
@@ -72,13 +72,13 @@ def parse(description) {
log.info "Bridge response: $msg.body" log.info "Bridge response: $msg.body"
} else { } else {
// Sending Bulbs List to parent" // Sending Bulbs List to parent"
if (parent.state.inBulbDiscovery) if (parent.isInBulbDiscovery())
log.info parent.bulbListHandler(device.hub.id, msg.body) log.info parent.bulbListHandler(device.hub.id, msg.body)
} }
} }
else if (contentType?.contains("xml")) { else if (contentType?.contains("xml")) {
log.debug "HUE BRIDGE ALREADY PRESENT" log.debug "HUE BRIDGE ALREADY PRESENT"
parent.hubVerification(device.hub.id, msg.body) parent.hubVerification(device.hub.id, msg.body)
} }
} }
} }

View File

@@ -757,6 +757,10 @@ def isValidSource(macAddress) {
return (vbridges?.find {"${it.value.mac}" == macAddress}) != null return (vbridges?.find {"${it.value.mac}" == macAddress}) != null
} }
def isInBulbDiscovery() {
return state.inBulbDiscovery
}
///////////////////////////////////// /////////////////////////////////////
//CHILD DEVICE METHODS //CHILD DEVICE METHODS
///////////////////////////////////// /////////////////////////////////////