From: Seyed Amir Hossein Aqajari Date: Tue, 6 Aug 2019 00:42:12 +0000 (-0700) Subject: Update sonos-music-modes.groovy X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=b3f93f967aeb8bed13cb25a50e5b70a8de2e891c;p=smartapps.git Update sonos-music-modes.groovy --- diff --git a/official/sonos-music-modes.groovy b/official/sonos-music-modes.groovy index f4ecdcc..fa8da4a 100755 --- a/official/sonos-music-modes.groovy +++ b/official/sonos-music-modes.groovy @@ -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" }