Update influxdb-logger.groovy
[smartapps.git] / official / step-notifier.groovy
index 9e92c2ead0370ef95aff485554d12f00745a2c75..e2c07fbe4e62c3a06f818956df949558b3f12f42 100755 (executable)
@@ -25,7 +25,6 @@ definition(
 
 preferences {
        page(name: "setupNotifications")
-    page(name: "chooseTrack", title: "Select a song or station")
        page(name: "timeIntervalInput", title: "Only during a certain time") {
                section {
                        input "starting", "time", title: "Starting", required: false
@@ -43,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
@@ -83,18 +82,10 @@ def setupNotifications() {
     }
 }
 
-def chooseTrack() {
-       dynamicPage(name: "chooseTrack") {
-               section{
-                       input "song","enum",title:"Play this track", required:true, multiple: false, options: songOptions()
-               }
-       }
-}
-
 private songOptions() {
 
        // Make sure current selection is in the set
-
+       /*
        def options = new LinkedHashSet()
        if (state.selectedSong?.station) {
                options << state.selectedSong.station
@@ -110,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"
@@ -135,7 +128,8 @@ private saveSelectedSong() {
        }
        catch (Throwable t) {
                log.error t
-       }
+       }*/
+       state.selectedSong = "SomeTrack"        
 }
 
 def installed() {
@@ -156,7 +150,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)