1 //Create a class for momentory switch device
3 import SmartThing.SmartThing
5 public class Momentary extends SmartThing {
6 // id, label, and display name of the device
11 Momentary(Closure sendEvent, String id, String label, String displayName) {
13 labelSmartThing = label
14 displayNameSmartThing = displayName
15 sendEventSmartThings = sendEvent
20 this.displayName = displayName
23 // Methods to set values
25 setValue([name: "momentary", value: "pushed", deviceId: id, descriptionText: "",
26 displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])