Update turn-on-before-sunset.groovy
[smartapps.git] / official / bose-soundtouch-control.groovy
index e9f695a9eb69431945687d86d79ba1eb3d9ab9b0..a159320691b80a2a50bac9d03a7f6585e64edb31 100755 (executable)
@@ -37,6 +37,20 @@ preferences {
        }
 }
 
+// input "motion", "capability.motionSensor", title: "Motion Here", required: false, multiple: true
+// input "contact", "capability.contactSensor", title: "Contact Opens", required: false, multiple: true
+// input "contactClosed", "capability.contactSensor", title: "Contact Closes", required: false, multiple: true
+// input "acceleration", "capability.accelerationSensor", title: "Acceleration Detected", required: false, multiple: true
+// input "mySwitch", "capability.switch", title: "Switch Turned On", required: false, multiple: true
+// input "mySwitchOff", "capability.switch", title: "Switch Turned Off", required: false, multiple: true
+// input "arrivalPresence", "capability.presenceSensor", title: "Arrival Of", required: false, multiple: true
+// input "departurePresence", "capability.presenceSensor", title: "Departure Of", required: false, multiple: true
+// input "smoke", "capability.smokeDetector", title: "Smoke Detected", required: false, multiple: true
+// input "water", "capability.waterSensor", title: "Water Sensor Wet", required: false, multiple: true
+// input "button1", "capability.button", title: "Button Press", required:false, multiple:true //remove from production
+// input "triggerModes", "mode", title: "System Changes Mode", required: false, multiple: true
+// input "timeOfDay", "time", title: "At a Scheduled Time", required: false
+
 def mainPage() {
        dynamicPage(name: "mainPage") {
                def anythingSet = anythingSet()
@@ -78,13 +92,7 @@ def mainPage() {
                                "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 {
@@ -192,12 +200,12 @@ def eventHandler1(evt) {
 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) {
@@ -234,24 +242,6 @@ private takeAction(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"
        }