From bd9a1d1dc59524a2eedbff8e4bc2713643c91cef Mon Sep 17 00:00:00 2001 From: boggebe Date: Mon, 8 Feb 2016 16:03:01 -0600 Subject: [PATCH] Closure was causing sandbox issues locally --- .../smartsense-multi-sensor.groovy | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/devicetypes/smartthings/smartsense-multi-sensor.src/smartsense-multi-sensor.groovy b/devicetypes/smartthings/smartsense-multi-sensor.src/smartsense-multi-sensor.groovy index 7c6a423..de53cb3 100644 --- a/devicetypes/smartthings/smartsense-multi-sensor.src/smartsense-multi-sensor.groovy +++ b/devicetypes/smartthings/smartsense-multi-sensor.src/smartsense-multi-sensor.groovy @@ -487,11 +487,6 @@ def enrollResponse() { } private Map parseAxis(String description) { - def hexToSignedInt = { hexVal -> - def unsignedVal = hexToInt(hexVal) - unsignedVal > 32767 ? unsignedVal - 65536 : unsignedVal - } - def z = hexToSignedInt(description[0..3]) def y = hexToSignedInt(description[10..13]) def x = hexToSignedInt(description[20..23]) @@ -518,6 +513,11 @@ private Map parseAxis(String description) { getXyzResult(xyzResults, description) } +private hexToSignedInt(hexVal) { + def unsignedVal = hexToInt(hexVal) + unsignedVal > 32767 ? unsignedVal - 65536 : unsignedVal +} + def garageEvent(zValue) { def absValue = zValue.abs() def contactValue = null