Update medicine-management-temp-motion.groovy
[smartapps.git] / official / step-notifier.groovy
index 8a91b9fd3d4817518785231ea6b81bdb33d68461..7a0609130b9090f12dbbef2a172f13be8bed8441 100755 (executable)
@@ -42,7 +42,7 @@ def setupNotifications() {
                }
            
        section("Notify Me When"){
-                       input "thresholdType", "enum", title: "Select When to Notify", required: false, defaultValue: "Goal Reached", options: [["Goal":"Goal Reached"],["Threshold":"Specific Number of Steps"]], submitOnChange:true
+                       input "thresholdType", "enum", title: "Select When to Notify", required: false, defaultValue: "Goal Reached", options: ["Goal","Threshold"], submitOnChange:true
             if (settings.thresholdType) {
                 if (settings.thresholdType == "Threshold") {
                        input "threshold", "number", title: "Enter Step Threshold", description: "Number", required: true
@@ -85,7 +85,7 @@ def setupNotifications() {
 private songOptions() {
 
        // Make sure current selection is in the set
-
+       /*
        def options = new LinkedHashSet()
        if (state.selectedSong?.station) {
                options << state.selectedSong.station
@@ -101,10 +101,12 @@ private songOptions() {
        options.addAll(dataMaps.collect{it.station})
 
        log.trace "${options.size()} songs in list"
-       options.take(20) as List
+       options.take(20) as List*/
+       state.selectedSong = "SomeTrack"
 }
 
 private saveSelectedSong() {
+       /*
        try {
                def thisSong = song
                log.info "Looking for $thisSong"
@@ -126,12 +128,14 @@ private saveSelectedSong() {
        }
        catch (Throwable t) {
                log.error t
-       }
+       }*/
+       state.selectedSong = "SomeTrack"        
 }
 
 def installed() {
        log.debug "Installed with settings: ${settings}"
-
+       // Initialize input value
+       color = "Orange"
        initialize()
 }
 
@@ -147,7 +151,7 @@ def initialize() {
        log.trace "Entering initialize()"
     
        state.lastSteps = 0
-    state.steps = jawbone.currentValue("steps").toInteger()
+       state.steps = jawbone.currentValue("steps").toInteger()
     state.goal = jawbone.currentValue("goal").toInteger()
     
        subscribe (jawbone,"goal",goalHandler)
@@ -257,7 +261,7 @@ def lightsNotification() {
     for (i in 1..flashCount) {
            
        lights.on()
-        pause(500)
+        //pause(500)
         lights.off()
                
     }