Changes in classes: new concept for latest value + all types of events generated...
[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 String id
7         private int isTouched
8         private String label
9
10         Touched(Closure sendEvent, int isTouched) {
11                 this.sendEvent = sendEvent
12                 this.isTouched = isTouched
13                 this.label = "app0"
14                 this.id = "appID0"
15         }
16
17         //By Model Checker
18         def setValue(LinkedHashMap eventDataMap) {
19                 println("The application is Touched!")
20                 this.isTouched = 1 //Do we need this?
21                 sendEvent(eventDataMap)
22         }
23 }