Adding 'level' for colorControl.
[smartthings-infrastructure.git] / SpeechSynthesis / SpeechSynthesises.groovy
index 2ef8cec28f8b0bebfd640103524550f14e041e92..2a125987d1806787f72821694a14bda378ab40fd 100644 (file)
@@ -22,8 +22,8 @@ public class SpeechSynthesises {
                this.deviceNumbers = deviceNumbers
                this.speechSynthesises = []
 
-               def init = Verify.getIntFromList(30, 50, 70)
-               this.level = init
+               //def init = Verify.getIntFromList(30, 50, 70)
+               //this.level = init
 
                speechSynthesises.add(new SpeechSynthesis(id, label, displayName, this.level))
        }
@@ -41,14 +41,17 @@ public class SpeechSynthesises {
        def find(Closure Input) {
                speechSynthesises.find(Input)
        }
+       def sort(Closure Input) {
+               speechSynthesises.sort(Input)
+       }
        def collect(Closure Input) {
                speechSynthesises.collect(Input)
        }
 
        def setLevel(int level) {
                if (level != this.level) {
-                       speechSynthesises[0].setLevel(level)
                        this.level = level
+                       speechSynthesises[0].setLevel(level)
                }
        }