X-Git-Url: http://plrg.eecs.uci.edu/git/?p=smartthings-infrastructure.git;a=blobdiff_plain;f=Momentary%2FMomentary.groovy;fp=Momentary%2FMomentary.groovy;h=27e49c2d08aa27b806a579c307121d940e5cd98d;hp=4e72815d45f93348435de768f10c541e94cb99d5;hb=2d26e7af07daad1394408bdcf76150b5aacf3a8a;hpb=83071d3bcfc33f015ece13868342644498a9dda3 diff --git a/Momentary/Momentary.groovy b/Momentary/Momentary.groovy index 4e72815..27e49c2 100644 --- a/Momentary/Momentary.groovy +++ b/Momentary/Momentary.groovy @@ -4,11 +4,11 @@ import SmartThing.SmartThing public class Momentary extends SmartThing { // id, label, and display name of the device - StringBuilder id = new StringBuilder() - StringBuilder label = new StringBuilder() - StringBuilder displayName = new StringBuilder() + String id + String label + String displayName - Momentary(Closure sendEvent, StringBuilder id, StringBuilder label, StringBuilder displayName) { + Momentary(Closure sendEvent, String id, String label, String displayName) { idSmartThing = id labelSmartThing = label displayNameSmartThing = displayName @@ -22,8 +22,7 @@ public class Momentary extends SmartThing { // Methods to set values def push() { - println("the momentary switch with id:$id is pushed!") - sendEvent([name: "momentary", value: "pushed", deviceId: id, descriptionText: "", - displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}']) + setValue([name: "momentary", value: "pushed", deviceId: id, descriptionText: "", + displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}']) } }