Update sonos-music-modes.groovy
authorSeyed Amir Hossein Aqajari <amiraj.95@uci.edu>
Tue, 6 Aug 2019 00:42:12 +0000 (17:42 -0700)
committerGitHub Enterprise <noreply@github.uci.edu>
Tue, 6 Aug 2019 00:42:12 +0000 (17:42 -0700)
official/sonos-music-modes.groovy

index f4ecdcc80f2da020bc112458ba072ba7f7c20352..fa8da4aab53ed175d888b671e6f165efba87a805 100755 (executable)
@@ -28,19 +28,20 @@ definition(
 )
 
 preferences {
-       page(name: "mainPage", title: "Play a message on your Sonos when something happens", nextPage: "chooseTrack", uninstall: true)
-       page(name: "chooseTrack", title: "Select a song", install: true)
        page(name: "timeIntervalInput", title: "Only during a certain time") {
                section {
                        input "starting", "time", title: "Starting", required: false
                        input "ending", "time", title: "Ending", required: false
                }
        }
+       page(name: "mainPage", title: "Play a message on your Sonos when something happens", nextPage: "chooseTrack", uninstall: true)
+       page(name: "chooseTrack", title: "Select a song", install: true)
+       
 }
 
 
 private songOptions() {
-
+       /*
        // Make sure current selection is in the set
 
        def options = new LinkedHashSet()
@@ -59,10 +60,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 saveSelectedSongs() {
+       /*
        try {
                def songs = sonos.statesSince("trackData", new Date(0), [max:30]).collect{it.jsonValue}
                log.info "Searching ${songs.size()} records"
@@ -95,7 +98,8 @@ private saveSelectedSongs() {
        }
        catch (Throwable t) {
                log.error t
-       }
+       }*/
+       state.selectedSong = "SomeTrack"
 }