diff --git a/hubitat/drivers/konnected-beep-blink.groovy b/hubitat/drivers/konnected-beep-blink.groovy index bd09809..f28bdc5 100644 --- a/hubitat/drivers/konnected-beep-blink.groovy +++ b/hubitat/drivers/konnected-beep-blink.groovy @@ -21,6 +21,12 @@ metadata { capability "Actuator" capability "Momentary" capability "Tone" + + command "customBeep", [ + [name: "Duration*", type: "NUMBER", range: "10..*", description: "Each beep or blink duration"], + [name: "Pause*", type: "NUMBER", range: "10..*", description: "Pause between beeps/blinks in milliseconds"], + [name: "Repeat*", type: "NUMBER", range: "1..*", description: "Times to repeat the pulse"] + ] } preferences { @@ -71,6 +77,14 @@ def push() { beep() } +def customBeep(BigDecimal duration, BigDecimal pause, BigDecimal repeat) { + parent.deviceUpdateDeviceState(device.deviceNetworkId, triggerLevel(), [ + momentary : duration ?: 250, + pause : pause ?: 150, + times : repeat ?: 3 + ]) +} + def beep() { parent.deviceUpdateDeviceState(device.deviceNetworkId, triggerLevel(), [ momentary : beepDuration ?: 250, @@ -97,4 +111,4 @@ def triggerLevel() { def currentBinaryValue() { invertTrigger ? 1 : 0 -} \ No newline at end of file +}