1 //Create a class for momentory switch device
3 import Timer.SimulatedTimer
5 public class Momentary {
8 private String displayName
12 Momentary(Closure sendEvent, String id, String label, String displayName) {
13 this.sendEvent = sendEvent
16 this.displayName = displayName
21 println("the momentary switch with id:$id is pushed!")
22 sendEvent([name: "momentary", value: "pushed", deviceId: this.id, descriptionText: "",
23 displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
27 def setValue(String value) {
28 println("the momentary switch with id:$id is pushed!")