From b3f93f967aeb8bed13cb25a50e5b70a8de2e891c Mon Sep 17 00:00:00 2001 From: Seyed Amir Hossein Aqajari Date: Mon, 5 Aug 2019 17:42:12 -0700 Subject: [PATCH] Update sonos-music-modes.groovy --- official/sonos-music-modes.groovy | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) 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" } -- 2.34.1