1 //Create a class for speech synthesis
2 package SpeechSynthesis
3 import SmartThing.SmartThings
5 public class SpeechSynthesises extends SmartThings {
6 List speechSynthesises = new ArrayList()
8 SpeechSynthesises(Closure sendEvent, boolean init) {
9 // Only initialize one time since we only have one device for each capability
10 speechSynthesises = smartThings
13 String id = "speechSynthesisID0"
14 String label = "level"
15 String displayName = "speechSynthesiser"
23 speechSynthesises.add(new SpeechSynthesis(sendEvent, id, label, displayName, level))
26 // Methods to set values
27 def setLevel(int level) {
28 speechSynthesises[0].setLevel(level)
31 def speak(String message) {
32 speechSynthesises[0].speak(message)