X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=NfcTouch%2FNfcTouch.groovy;h=80ce59d66650bec55d312470c3cb7da5b4d4adbc;hb=d0b538d93e64c63d2673796db08570953b57f947;hp=3635d51492d99e7a0894b0669f0aa662092e9271;hpb=2932def9bb947d617975235763f7338360f0e5a4;p=smartthings-infrastructure.git diff --git a/NfcTouch/NfcTouch.groovy b/NfcTouch/NfcTouch.groovy index 3635d51..80ce59d 100644 --- a/NfcTouch/NfcTouch.groovy +++ b/NfcTouch/NfcTouch.groovy @@ -1,20 +1,22 @@ //Create a class for Touch sensor package NfcTouch +import SmartThing.SmartThing -public class NfcTouch{ - def sendEvent - private int isTouched - private String displayName = "NfcTouch0" +public class NfcTouch extends SmartThing { + // id, label, and display name of the device + StringBuilder id = new StringBuilder() + StringBuilder label = new StringBuilder() + StringBuilder displayName = new StringBuilder() - NfcTouch(Closure sendEvent, int isTouched) { - this.sendEvent = sendEvent - this.isTouched = isTouched - } + NfcTouch(Closure sendEvent) { + idSmartThing = id + labelSmartThing = label + displayNameSmartThing = displayName + sendEventSmartThings = sendEvent - //By Model Checker - def setValue(LinkedHashMap eventDataMap) { - println("NFC is Touched!") - this.isTouched = 1 //Do we need this? - sendEvent(eventDataMap) + // Initialization + id.append("nfcSensorID0") + label.append("nfcSensor") + displayName.append("nfcSensor0") } }