Commit #6
[smartthings-infrastructure.git] / appTouch / Touched.groovy
1 //Create a class for Touch sensor
2 package appTouch
3
4 public class Touched{
5         def sendEvent
6         private int isTouched
7
8         Touched(Closure sendEvent, int isTouched) {
9                 this.sendEvent = sendEvent
10                 this.isTouched = isTouched
11         }
12
13         //By Model Checker
14         def setValue(LinkedHashMap eventDataMap) {
15                 println("The application is Touched!")
16                 this.isTouched = 1 //Do we need this?
17                 sendEvent(eventDataMap)
18         }
19 }