"Turn Off",
"Toggle Play/Pause",
"Skip to Next Track",
- "Skip to Beginning/Previous Track",
- "Play Preset 1",
- "Play Preset 2",
- "Play Preset 3",
- "Play Preset 4",
- "Play Preset 5",
- "Play Preset 6"
+ "Skip to Beginning/Previous Track"
]
}
section {
section("More options", hideable: true, hidden: true) {
input "volume", "number", title: "Set the volume volume", description: "0-100%", required: false
input "frequency", "decimal", title: "Minimum time between actions (defaults to every event)", description: "Minutes", required: false
- href "timeIntervalInput", title: "Only during a certain time", description: timeLabel ?: "Tap to set", state: timeLabel ? "complete" : "incomplete"
+ href "timeIntervalInput", title: "Only during a certain time"
input "days", "enum", title: "Only on certain days of the week", multiple: true, required: false,
options: ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]
- if (settings.modes) {
+ //if (settings.modes) {
input "modes", "mode", title: "Only when mode is", multiple: true, required: false
- }
+ // }
input "oncePerDay", "bool", title: "Only once per day", required: false, defaultValue: false
}
section([mobileOnly:true]) {
def subscribeToEvents() {
log.trace "subscribeToEvents()"
subscribe(app, appTouchHandler)
- subscribe(contact, "contact.open", eventHandler)
- subscribe(contactClosed, "contact.closed", eventHandler)
- subscribe(acceleration, "acceleration.active", eventHandler)
- subscribe(motion, "motion.active", eventHandler)
- subscribe(mySwitch, "switch.on", eventHandler)
- subscribe(mySwitchOff, "switch.off", eventHandler)
- subscribe(arrivalPresence, "presence.present", eventHandler)
- subscribe(departurePresence, "presence.not present", eventHandler)
- subscribe(smoke, "smoke.detected", eventHandler)
- subscribe(smoke, "smoke.tested", eventHandler)
- subscribe(smoke, "carbonMonoxide.detected", eventHandler)
- subscribe(water, "water.wet", eventHandler)
- subscribe(button1, "button.pushed", eventHandler)
+ subscribe(contact, "contact.open", eventHandler1)
+ subscribe(contactClosed, "contact.closed", eventHandler1)
+ subscribe(acceleration, "acceleration.active", eventHandler1)
+ subscribe(motion, "motion.active", eventHandler1)
+ subscribe(mySwitch, "switch.on", eventHandler1)
+ subscribe(mySwitchOff, "switch.off", eventHandler1)
+ subscribe(arrivalPresence, "presence.present", eventHandler1)
+ subscribe(departurePresence, "presence.not present", eventHandler1)
+ subscribe(smoke, "smoke.detected", eventHandler1)
+ subscribe(smoke, "smoke.tested", eventHandler1)
+ subscribe(smoke, "carbonMonoxide.detected", eventHandler1)
+ subscribe(water, "water.wet", eventHandler1)
+ subscribe(button1, "button.pushed", eventHandler1)
if (triggerModes) {
subscribe(location, modeChangeHandler)
}
}
-def eventHandler(evt) {
+def eventHandler1(evt) {
if (allOk) {
def lastTime = state[frequencyKey(evt)]
if (oncePerDayOk(lastTime)) {
def modeChangeHandler(evt) {
log.trace "modeChangeHandler $evt.name: $evt.value ($triggerModes)"
if (evt.value in triggerModes) {
- eventHandler(evt)
+ eventHandler1(evt)
}
}
def scheduledTimeHandler() {
- eventHandler(null)
+ //eventHandler(null)
}
def appTouchHandler(evt) {
case "Skip to Beginning/Previous Track":
options ? bose.previousTrack(options) : bose.previousTrack()
break
- case "Play Preset 1":
- options ? bose.preset1(options) : bose.preset1()
- break
- case "Play Preset 2":
- options ? bose.preset2(options) : bose.preset2()
- break
- case "Play Preset 3":
- options ? bose.preset3(options) : bose.preset3()
- break
- case "Play Preset 4":
- options ? bose.preset4(options) : bose.preset4()
- break
- case "Play Preset 5":
- options ? bose.preset5(options) : bose.preset5()
- break
- case "Play Preset 6":
- options ? bose.preset6(options) : bose.preset6()
- break
default:
log.error "Action type '$actionType' not defined"
}