[DVCSMP-2117] Fix NPE for unknown descriptions in parse

This commit is contained in:
jackchi
2016-10-10 09:02:59 -07:00
parent 6dbb61536b
commit 2c2d75ae37
4 changed files with 4 additions and 4 deletions

View File

@@ -106,7 +106,7 @@ def parse(String description) {
else {
def cluster = zigbee.parse(description)
if (cluster.clusterId == 0x0006 && cluster.command == 0x07){
if (cluster && cluster.clusterId == 0x0006 && cluster.command == 0x07){
if (cluster.data[0] == 0x00) {
log.debug "ON/OFF REPORTING CONFIG RESPONSE: " + cluster
sendEvent(name: "checkInterval", value: 60 * 12, displayed: false, data: [protocol: "zigbee", hubHardwareId: device.hub.hardwareID])

View File

@@ -62,7 +62,7 @@ def parse(String description) {
else {
def cluster = zigbee.parse(description)
if (cluster.clusterId == 0x0006 && cluster.command == 0x07) {
if (cluster && cluster.clusterId == 0x0006 && cluster.command == 0x07) {
if (cluster.data[0] == 0x00) {
log.debug "ON/OFF REPORTING CONFIG RESPONSE: " + cluster
sendEvent(name: "checkInterval", value: 60 * 12, displayed: false, data: [protocol: "zigbee", hubHardwareId: device.hub.hardwareID])

View File

@@ -107,7 +107,7 @@ def parse(String description) {
sendEvent(name: "saturation", value: saturationValue, descriptionText: "Color has changed", displayed: false)
}
}
else if (cluster.clusterId == 0x0006 && cluster.command == 0x07) {
else if (cluster && cluster.clusterId == 0x0006 && cluster.command == 0x07) {
if (cluster.data[0] == 0x00){
log.debug "ON/OFF REPORTING CONFIG RESPONSE: " + cluster
sendEvent(name: "checkInterval", value: 60 * 12, displayed: false, data: [protocol: "zigbee", hubHardwareId: device.hub.hardwareID])

View File

@@ -85,7 +85,7 @@ def parse(String description) {
else {
def cluster = zigbee.parse(description)
if (cluster.clusterId == 0x0006 && cluster.command == 0x07) {
if (cluster && cluster.clusterId == 0x0006 && cluster.command == 0x07) {
if (cluster.data[0] == 0x00) {
log.debug "ON/OFF REPORTING CONFIG RESPONSE: " + cluster
sendEvent(name: "checkInterval", value: 60 * 12, displayed: false, data: [protocol: "zigbee", hubHardwareId: device.hub.hardwareID])