Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion hubitat/drivers/konnected-beep-blink.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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,
Expand All @@ -97,4 +111,4 @@ def triggerLevel() {

def currentBinaryValue() {
invertTrigger ? 1 : 0
}
}