X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=appTouch%2FTouched.groovy;h=980a05a10608784634a7e77c244721d9a7df57a4;hb=99cb061a37c14b85e58882a9e82b6c8dd9e9188b;hp=530d64b2e906ff1e1ea81184ff1aaf615b7daa81;hpb=285570e387d51040a4c14ac604a6cc6ea68e0f9d;p=smartthings-infrastructure.git diff --git a/appTouch/Touched.groovy b/appTouch/Touched.groovy index 530d64b..980a05a 100644 --- a/appTouch/Touched.groovy +++ b/appTouch/Touched.groovy @@ -1,19 +1,22 @@ //Create a class for Touch sensor package appTouch +import SmartThing.SmartThing -public class Touched{ - def sendEvent - private int isTouched +public class Touched extends SmartThing { + // id, label, and display name of the device + StringBuilder id = new StringBuilder() + StringBuilder label = new StringBuilder() + StringBuilder displayName = new StringBuilder() - Touched(Closure sendEvent, int isTouched) { - this.sendEvent = sendEvent - this.isTouched = isTouched - } + Touched(Closure sendEvent) { + idSmartThing = id + labelSmartThing = label + displayNameSmartThing = displayName + sendEventSmartThings = sendEvent - //By Model Checker - def setValue(LinkedHashMap eventDataMap) { - println("The application is Touched!") - this.isTouched = 1 //Do we need this? - sendEvent(eventDataMap) + // Initialization + id.append("appTouchID0") + label.append("appTouch") + displayName.append("appTouch0") } }