diff --git a/devicetypes/darwinsden/wd100-dimmer.src/wd100-dimmer.groovy b/devicetypes/darwinsden/wd100-dimmer.src/wd100-dimmer.groovy index 10b33e439c5..de4fee3520a 100644 --- a/devicetypes/darwinsden/wd100-dimmer.src/wd100-dimmer.groovy +++ b/devicetypes/darwinsden/wd100-dimmer.src/wd100-dimmer.groovy @@ -257,6 +257,7 @@ def zwaveEvent(physicalgraph.zwave.Command cmd) { } def on() { + sendEvent(tapUp1Response("digital")) delayBetween([ zwave.basicV1.basicSet(value: 0xFF).format(), zwave.switchMultilevelV1.switchMultilevelGet().format() @@ -264,6 +265,7 @@ def on() { } def off() { + sendEvent(tapDown1Response("digital")) delayBetween([ zwave.basicV1.basicSet(value: 0x00).format(), zwave.switchMultilevelV1.switchMultilevelGet().format() @@ -307,10 +309,10 @@ def zwaveEvent(physicalgraph.zwave.commands.centralscenev1.CentralSceneNotificat // Up switch (cmd.keyAttributes) { case 0: + // Press Once + result += createEvent(tapUp1Response("physical")) + result += response("delay 100") result += createEvent([name: "switch", value: "on", type: "physical"]) - sendEvent(name: "status" , value: "Tap ▲") - sendEvent(name: "button" , value: "pushed", data: [buttonNumber: "7"], descriptionText: "$device.displayName Tap-Up-1 (button 7) pressed", - isStateChange: true, type: "$buttonType") if (singleTapToFullBright) { @@ -352,10 +354,10 @@ def zwaveEvent(physicalgraph.zwave.commands.centralscenev1.CentralSceneNotificat // Down switch (cmd.keyAttributes) { case 0: - result=createEvent([name: "switch", value: "off", type: "physical"]) - sendEvent(name: "status" , value: "Tap ▼") - sendEvent(name: "button" , value: "pushed", data: [buttonNumber: "8"], descriptionText: "$device.displayName Tap-Down-1 (button 8) pressed", - isStateChange: true, type: "$buttonType") + // Press Once + result += createEvent(tapDown1Response("physical")) + result += response("delay 100") + result += createEvent([name: "switch", value: "off", type: "physical"]) break case 1: result=createEvent([name: "switch", value: "off", type: "physical"]) @@ -391,6 +393,18 @@ def zwaveEvent(physicalgraph.zwave.commands.centralscenev1.CentralSceneNotificat return result } +def tapUp1Response(String buttonType) { + sendEvent(name: "status" , value: "Tap ▲") + [name: "button", value: "pushed", data: [buttonNumber: "7"], descriptionText: "$device.displayName Tap-Up-1 (button 7) pressed", + isStateChange: true, type: "$buttonType"] +} + +def tapDown1Response(String buttontype) { + sendEvent(name: "status" , value: "Tap ▼") + [name: "button", value: "pushed", data: [buttonNumber: "8"], descriptionText: "$device.displayName Tap-Down-1 (button 8) pressed", + isStateChange: true, type: "$buttonType"] +} + def tapUp2Response(String buttonType) { sendEvent(name: "status" , value: "Tap ▲▲") [name: "button", value: "pushed", data: [buttonNumber: "1"], descriptionText: "$device.displayName Tap-Up-2 (button 1) pressed", @@ -533,4 +547,4 @@ def updated() def cmds= [] cmds << setDimRatePrefs delayBetween(cmds, 500) -} \ No newline at end of file +}