From e861d3c256022aa192abba92bfeb997367bc701b Mon Sep 17 00:00:00 2001 From: Rohan Desai Date: Thu, 9 Jun 2016 10:28:18 -0700 Subject: [PATCH 1/2] added fix for NPE --- .../netatmo-connect.src/netatmo-connect.groovy | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/smartapps/dianoga/netatmo-connect.src/netatmo-connect.groovy b/smartapps/dianoga/netatmo-connect.src/netatmo-connect.groovy index a127d5b..7a9e946 100644 --- a/smartapps/dianoga/netatmo-connect.src/netatmo-connect.groovy +++ b/smartapps/dianoga/netatmo-connect.src/netatmo-connect.groovy @@ -337,10 +337,10 @@ def initialize() { settings.devices.each { def deviceId = it - def detail = state.deviceDetail[deviceId] + def detail = state?.deviceDetail[deviceId] try { - switch(detail.type) { + switch(detail?.type) { case 'NAMain': log.debug "Base station" createChildDevice("Netatmo Basestation", deviceId, "${detail.type}.${deviceId}", detail.module_name) @@ -487,12 +487,12 @@ def poll() { log.debug "State: ${state.deviceState}" settings.devices.each { deviceId -> - def detail = state.deviceDetail[deviceId] - def data = state.deviceState[deviceId] - def child = children.find { it.deviceNetworkId == deviceId } + def detail = state?.deviceDetail[deviceId] + def data = state?.deviceState[deviceId] + def child = children?.find { it.deviceNetworkId == deviceId } log.debug "Update: $child"; - switch(detail.type) { + switch(detail?.type) { case 'NAMain': log.debug "Updating NAMain $data" child?.sendEvent(name: 'temperature', value: cToPref(data['Temperature']) as float, unit: getTemperatureScale()) From 45a0822e9bb7576f8431ec9682de00648446f2fc Mon Sep 17 00:00:00 2001 From: Donald Kirker Date: Tue, 14 Jun 2016 11:07:31 -0700 Subject: [PATCH 2/2] Add re-type for Vision Motion Sensor Plus. --- .../zwave-door-window-sensor.groovy | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/devicetypes/smartthings/zwave-door-window-sensor.src/zwave-door-window-sensor.groovy b/devicetypes/smartthings/zwave-door-window-sensor.src/zwave-door-window-sensor.groovy index 2c020df..6011f7e 100644 --- a/devicetypes/smartthings/zwave-door-window-sensor.src/zwave-door-window-sensor.groovy +++ b/devicetypes/smartthings/zwave-door-window-sensor.src/zwave-door-window-sensor.groovy @@ -29,6 +29,7 @@ metadata { fingerprint deviceId: "0x0701", inClusters: "0x5E,0x86,0x72,0x98", outClusters: "0x5A,0x82" fingerprint deviceId: "0x0701", inClusters: "0x5E,0x80,0x71,0x85,0x70,0x72,0x86,0x30,0x31,0x84,0x59,0x73,0x5A,0x8F,0x98,0x7A", outClusters:"0x20" // Philio multi+ fingerprint deviceId: "0x0701", inClusters: "0x5E,0x72,0x5A,0x80,0x73,0x86,0x84,0x85,0x59,0x71,0x70,0x7A,0x98" // Vision door/window + fingerprint deviceId: "0x0701", inClusters: "0x5E,0x98,0x86,0x72,0x5A,0x85,0x59,0x73,0x80,0x71,0x31,0x70,0x84,0x7A" // Vision Motion } // simulator metadata @@ -263,5 +264,9 @@ def retypeBasedOnMSR() { log.debug "Changing device type to Door / Window Sensor Plus (SG)" setDeviceType("Door / Window Sensor Plus (SG)") break + case "0109-2002-0205": // Vision Motion + log.debug "Changing device type to Vision Motion Sensor Plus (SG)" + setDeviceType("Vision Motion Sensor Plus (SG)") + break } }