Commit #4
[smartthings-infrastructure.git] / appTouch / Touched.groovy
diff --git a/appTouch/Touched.groovy b/appTouch/Touched.groovy
new file mode 100644 (file)
index 0000000..e2172cc
--- /dev/null
@@ -0,0 +1,19 @@
+//Create a class for Touch sensor
+package appTouch
+
+public class Touched{
+       def fun
+       private int isTouched
+
+       Touched(Closure sendEvent, int isTouched) {
+               fun = sendEvent
+               this.isTouched = isTouched
+       }
+
+       //By Model Checker
+       def setValue(LinkedHashMap eventDataMap) {
+               println("The application is Touched!")
+               this.isTouched = 1 //Do we need this?
+               fun(eventDataMap)
+       }
+}