Infrastructure that works for all the locks' group!
[smartthings-infrastructure.git] / SpeechSynthesis / SpeechSynthesis.groovy
1 //Create a class for speech synthesis
2 package SpeechSynthesis
3 import Timer.SimulatedTimer
4
5 public class SpeechSynthesis {
6         private String id
7         private String label
8         private String displayName
9         private int level
10
11
12         SpeechSynthesis(String id, String label, String displayName, int level) {
13                 this.id = id
14                 this.label = label
15                 this.displayName = displayName
16                 this.level = level
17         }
18
19         def setLevel(int level) {
20                 if (level != this.level) {
21                         println("The level of speech synthesis with id:$id is changed to $level")
22                         this.level = level
23                 }
24         }
25
26         def speak(String message) {
27                 println("Speech synthesis with id:$id, SPEAKING:\"$message\"!")
28         }
29 }