Improvements and new methods
[smartthings-infrastructure.git] / MusicPlayer / MusicPlayers.groovy
index a9693db..92f6c55 100644 (file)
@@ -172,6 +172,15 @@ public class MusicPlayers {
                        this.level = level
                }
        }
+       def playSoundAndTrack(String trackData, int duration, int trackNumber, int level) {
+               playTrackAndResume(trackData, duration)
+               if (level != this.level) {
+                       this.level = level
+               }
+               if (trackNumber!= this.trackNumber) {
+                       this.trackNumber = trackNumber
+               }
+       }
        def playTrackAtVolume(String trackData, int level) {
                playTrack(trackData)
                if (level != this.level) {
@@ -238,7 +247,7 @@ public class MusicPlayers {
                }
        }
        def statesSince(String info, Date dateObj, LinkedHashMap map) {
-               return presenceSensors[0].statesSince()
+               return musicPlayers[0].statesSince()
        }
        def playText(LinkedHashMap metaData) {
                playText()