From 4d243bf44df267c399d590490c4fcc85529c439a Mon Sep 17 00:00:00 2001 From: Yaima Valdivia Date: Tue, 27 Oct 2015 12:29:05 -0700 Subject: [PATCH] Rename Sonos SmartApps https://smartthings.atlassian.net/browse/DVCSMP-607 --- .../speaker-control.groovy} | 26 +++++++++---------- .../speaker-mood-music.groovy} | 18 ++++++------- .../speaker-notify-with-sound.groovy} | 20 +++++++------- .../speaker-weather-forecast.groovy} | 22 ++++++++-------- 4 files changed, 43 insertions(+), 43 deletions(-) rename smartapps/smartthings/{sonos-control.src/sonos-control.groovy => speaker-control.src/speaker-control.groovy} (92%) rename smartapps/smartthings/{sonos-mood-music.src/sonos-mood-music.groovy => speaker-mood-music.src/speaker-mood-music.groovy} (95%) rename smartapps/smartthings/{sonos-notify-with-sound.src/sonos-notify-with-sound.groovy => speaker-notify-with-sound.src/speaker-notify-with-sound.groovy} (94%) rename smartapps/smartthings/{sonos-weather-forecast.src/sonos-weather-forecast.groovy => speaker-weather-forecast.src/speaker-weather-forecast.groovy} (94%) diff --git a/smartapps/smartthings/sonos-control.src/sonos-control.groovy b/smartapps/smartthings/speaker-control.src/speaker-control.groovy similarity index 92% rename from smartapps/smartthings/sonos-control.src/sonos-control.groovy rename to smartapps/smartthings/speaker-control.src/speaker-control.groovy index 0c93665..0fc9982 100644 --- a/smartapps/smartthings/sonos-control.src/sonos-control.groovy +++ b/smartapps/smartthings/speaker-control.src/speaker-control.groovy @@ -10,24 +10,24 @@ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License * for the specific language governing permissions and limitations under the License. * - * Sonos Control + * Speaker Control * * Author: SmartThings * * Date: 2013-12-10 */ definition( - name: "Sonos Control", + name: "Speaker Control", namespace: "smartthings", author: "SmartThings", - description: "Play or pause your Sonos when certain actions take place in your home.", + description: "Play or pause your Speaker when certain actions take place in your home.", category: "SmartThings Labs", iconUrl: "https://s3.amazonaws.com/smartapp-icons/Partner/sonos.png", iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Partner/sonos@2x.png" ) preferences { - page(name: "mainPage", title: "Control your Sonos when something happens", install: true, uninstall: true) + page(name: "mainPage", title: "Control your Speaker when something happens", install: true, uninstall: true) page(name: "timeIntervalInput", title: "Only during a certain time") { section { input "starting", "time", title: "Starting", required: false @@ -81,7 +81,7 @@ def mainPage() { ] } section { - input "sonos", "capability.musicPlayer", title: "Sonos music player", required: true + input "speaker", "capability.musicPlayer", title: "Speaker music player", required: true } section("More options", hideable: true, hidden: true) { input "volume", "number", title: "Set the volume volume", description: "0-100%", required: false @@ -201,31 +201,31 @@ private takeAction(evt) { log.debug "takeAction($actionType)" def options = [:] if (volume) { - sonos.setLevel(volume as Integer) + speaker.setLevel(volume as Integer) options.delay = 1000 } switch (actionType) { case "Play": - options ? sonos.on(options) : sonos.on() + options ? speaker.on(options) : speaker.on() break case "Stop Playing": - options ? sonos.off(options) : sonos.off() + options ? speaker.off(options) : speaker.off() break case "Toggle Play/Pause": - def currentStatus = sonos.currentValue("status") + def currentStatus = speaker.currentValue("status") if (currentStatus == "playing") { - options ? sonos.pause(options) : sonos.pause() + options ? speaker.pause(options) : speaker.pause() } else { - options ? sonos.play(options) : sonos.play() + options ? speaker.play(options) : speaker.play() } break case "Skip to Next Track": - options ? sonos.nextTrack(options) : sonos.nextTrack() + options ? speaker.nextTrack(options) : speaker.nextTrack() break case "Play Previous Track": - options ? sonos.previousTrack(options) : sonos.previousTrack() + options ? speaker.previousTrack(options) : speaker.previousTrack() break default: log.error "Action type '$actionType' not defined" diff --git a/smartapps/smartthings/sonos-mood-music.src/sonos-mood-music.groovy b/smartapps/smartthings/speaker-mood-music.src/speaker-mood-music.groovy similarity index 95% rename from smartapps/smartthings/sonos-mood-music.src/sonos-mood-music.groovy rename to smartapps/smartthings/speaker-mood-music.src/speaker-mood-music.groovy index 8d013c2..bfb2965 100644 --- a/smartapps/smartthings/sonos-mood-music.src/sonos-mood-music.groovy +++ b/smartapps/smartthings/speaker-mood-music.src/speaker-mood-music.groovy @@ -10,7 +10,7 @@ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License * for the specific language governing permissions and limitations under the License. * - * Sonos Mood Music + * Speaker Mood Music * * Author: SmartThings * Date: 2014-02-12 @@ -31,7 +31,7 @@ private songOptions() { } // Query for recent tracks - def states = sonos.statesSince("trackData", new Date(0), [max:30]) + def states = speaker.statesSince("trackData", new Date(0), [max:30]) def dataMaps = states.collect{it.jsonValue} options.addAll(dataMaps.collect{it.station}) @@ -43,7 +43,7 @@ private saveSelectedSong() { try { def thisSong = song log.info "Looking for $thisSong" - def songs = sonos.statesSince("trackData", new Date(0), [max:30]).collect{it.jsonValue} + def songs = speaker.statesSince("trackData", new Date(0), [max:30]).collect{it.jsonValue} log.info "Searching ${songs.size()} records" def data = songs.find {s -> s.station == thisSong} @@ -65,7 +65,7 @@ private saveSelectedSong() { } definition( - name: "Sonos Mood Music", + name: "Speaker Mood Music", namespace: "smartthings", author: "SmartThings", description: "Plays a selected song or station.", @@ -75,7 +75,7 @@ definition( ) preferences { - page(name: "mainPage", title: "Play a selected song or station on your Sonos when something happens", nextPage: "chooseTrack", uninstall: true) + page(name: "mainPage", title: "Play a selected song or station on your Speaker 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 { @@ -125,7 +125,7 @@ def mainPage() { ifUnset "timeOfDay", "time", title: "At a Scheduled Time", required: false } section { - input "sonos", "capability.musicPlayer", title: "On this Sonos player", required: true + input "speaker", "capability.musicPlayer", title: "On this Speaker player", required: true } section("More options", hideable: true, hidden: true) { input "volume", "number", title: "Set the volume", description: "0-100%", required: false @@ -248,13 +248,13 @@ private takeAction(evt) { log.info "Playing '$state.selectedSong" if (volume != null) { - sonos.stop() + speaker.stop() pause(500) - sonos.setLevel(volume) + speaker.setLevel(volume) pause(500) } - sonos.playTrack(state.selectedSong) + speaker.playTrack(state.selectedSong) if (frequency || oncePerDay) { state[frequencyKey(evt)] = now() diff --git a/smartapps/smartthings/sonos-notify-with-sound.src/sonos-notify-with-sound.groovy b/smartapps/smartthings/speaker-notify-with-sound.src/speaker-notify-with-sound.groovy similarity index 94% rename from smartapps/smartthings/sonos-notify-with-sound.src/sonos-notify-with-sound.groovy rename to smartapps/smartthings/speaker-notify-with-sound.src/speaker-notify-with-sound.groovy index 0e4176c..a6bb17c 100644 --- a/smartapps/smartthings/sonos-notify-with-sound.src/sonos-notify-with-sound.groovy +++ b/smartapps/smartthings/speaker-notify-with-sound.src/speaker-notify-with-sound.groovy @@ -10,23 +10,23 @@ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License * for the specific language governing permissions and limitations under the License. * - * Sonos Custom Message + * Speaker Custom Message * * Author: SmartThings * Date: 2014-1-29 */ definition( - name: "Sonos Notify with Sound", + name: "Speaker Notify with Sound", namespace: "smartthings", author: "SmartThings", - description: "Play a sound or custom message through your Sonos when the mode changes or other events occur.", + description: "Play a sound or custom message through your Speaker when the mode changes or other events occur.", category: "SmartThings Labs", iconUrl: "https://s3.amazonaws.com/smartapp-icons/Partner/sonos.png", iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Partner/sonos@2x.png" ) preferences { - page(name: "mainPage", title: "Play a message on your Sonos when something happens", install: true, uninstall: true) + page(name: "mainPage", title: "Play a message on your Speaker when something happens", install: true, uninstall: true) page(name: "chooseTrack", title: "Select a song or station") page(name: "timeIntervalInput", title: "Only during a certain time") { section { @@ -92,7 +92,7 @@ def mainPage() { input "message","text",title:"Play this message", required:false, multiple: false } section { - input "sonos", "capability.musicPlayer", title: "On this Sonos player", required: true + input "speaker", "capability.musicPlayer", title: "On this Speaker player", required: true } section("More options", hideable: true, hidden: true) { input "resumePlaying", "bool", title: "Resume currently playing music after notification", required: false, defaultValue: true @@ -137,7 +137,7 @@ private songOptions() { } // Query for recent tracks - def states = sonos.statesSince("trackData", new Date(0), [max:30]) + def states = speaker.statesSince("trackData", new Date(0), [max:30]) def dataMaps = states.collect{it.jsonValue} options.addAll(dataMaps.collect{it.station}) @@ -149,7 +149,7 @@ private saveSelectedSong() { try { def thisSong = song log.info "Looking for $thisSong" - def songs = sonos.statesSince("trackData", new Date(0), [max:30]).collect{it.jsonValue} + def songs = speaker.statesSince("trackData", new Date(0), [max:30]).collect{it.jsonValue} log.info "Searching ${songs.size()} records" def data = songs.find {s -> s.station == thisSong} @@ -277,13 +277,13 @@ private takeAction(evt) { log.trace "takeAction()" if (song) { - sonos.playSoundAndTrack(state.sound.uri, state.sound.duration, state.selectedSong, volume) + speaker.playSoundAndTrack(state.sound.uri, state.sound.duration, state.selectedSong, volume) } else if (resumePlaying){ - sonos.playTrackAndResume(state.sound.uri, state.sound.duration, volume) + speaker.playTrackAndResume(state.sound.uri, state.sound.duration, volume) } else { - sonos.playTrackAndRestore(state.sound.uri, state.sound.duration, volume) + speaker.playTrackAndRestore(state.sound.uri, state.sound.duration, volume) } if (frequency || oncePerDay) { diff --git a/smartapps/smartthings/sonos-weather-forecast.src/sonos-weather-forecast.groovy b/smartapps/smartthings/speaker-weather-forecast.src/speaker-weather-forecast.groovy similarity index 94% rename from smartapps/smartthings/sonos-weather-forecast.src/sonos-weather-forecast.groovy rename to smartapps/smartthings/speaker-weather-forecast.src/speaker-weather-forecast.groovy index a730729..c1dd026 100644 --- a/smartapps/smartthings/sonos-weather-forecast.src/sonos-weather-forecast.groovy +++ b/smartapps/smartthings/speaker-weather-forecast.src/speaker-weather-forecast.groovy @@ -10,23 +10,23 @@ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License * for the specific language governing permissions and limitations under the License. * - * Sonos Weather Forecast + * Speaker Weather Forecast * * Author: SmartThings * Date: 2014-1-29 */ definition( - name: "Sonos Weather Forecast", + name: "Speaker Weather Forecast", namespace: "smartthings", author: "SmartThings", - description: "Play a weather report through your Sonos when the mode changes or other events occur", + description: "Play a weather report through your Speaker when the mode changes or other events occur", category: "SmartThings Labs", iconUrl: "https://s3.amazonaws.com/smartapp-icons/Partner/sonos.png", iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Partner/sonos@2x.png" ) preferences { - page(name: "mainPage", title: "Play the weather report on your sonos", install: true, uninstall: true) + page(name: "mainPage", title: "Play the weather report on your speaker", install: true, uninstall: true) page(name: "chooseTrack", title: "Select a song or station") page(name: "timeIntervalInput", title: "Only during a certain time") { section { @@ -85,7 +85,7 @@ def mainPage() { ) } section { - input "sonos", "capability.musicPlayer", title: "On this Sonos player", required: true + input "speaker", "capability.musicPlayer", title: "On this Speaker player", required: true } section("More options", hideable: true, hidden: true) { input "resumePlaying", "bool", title: "Resume currently playing music after weather report finishes", required: false, defaultValue: true @@ -223,16 +223,16 @@ private takeAction(evt) { loadText() if (song) { - sonos.playSoundAndTrack(state.sound.uri, state.sound.duration, state.selectedSong, volume) + speaker.playSoundAndTrack(state.sound.uri, state.sound.duration, state.selectedSong, volume) } else if (resumePlaying){ - sonos.playTrackAndResume(state.sound.uri, state.sound.duration, volume) + speaker.playTrackAndResume(state.sound.uri, state.sound.duration, volume) } else if (volume) { - sonos.playTrackAtVolume(state.sound.uri, volume) + speaker.playTrackAtVolume(state.sound.uri, volume) } else { - sonos.playTrack(state.sound.uri) + speaker.playTrack(state.sound.uri) } if (frequency || oncePerDay) { @@ -254,7 +254,7 @@ private songOptions() { } // Query for recent tracks - def states = sonos.statesSince("trackData", new Date(0), [max:30]) + def states = speaker.statesSince("trackData", new Date(0), [max:30]) def dataMaps = states.collect{it.jsonValue} options.addAll(dataMaps.collect{it.station}) @@ -266,7 +266,7 @@ private saveSelectedSong() { try { def thisSong = song log.info "Looking for $thisSong" - def songs = sonos.statesSince("trackData", new Date(0), [max:30]).collect{it.jsonValue} + def songs = speaker.statesSince("trackData", new Date(0), [max:30]).collect{it.jsonValue} log.info "Searching ${songs.size()} records" def data = songs.find {s -> s.station == thisSong}