//Create a class for speech synthesis package SpeechSynthesis import SmartThing.SmartThings //Importing mutable integer class import MutableInteger.MutableInteger public class SpeechSynthesises extends SmartThings { List speechSynthesises = new ArrayList() SpeechSynthesises(Closure sendEvent, boolean init) { // Only initialize one time since we only have one device for each capability speechSynthesises = smartThings // Initialization StringBuilder id = new StringBuilder("speechSynthesisID0") StringBuilder label = new StringBuilder("speechSynthesis") StringBuilder displayName = new StringBuilder("speechSynthesis0") MutableInteger level = new MutableInteger() if (init) level.setValue(50) else level.setValue(60) speechSynthesises.add(new SpeechSynthesis(sendEvent, id, label, displayName, level)) } // Methods to set values def setLevel(int level) { speechSynthesises[0].setLevel(level) } def speak(String message) { speechSynthesises[0].speak(message) } // Methods to return values def getCurrentLevel() { List tmpValues = new ArrayList() tmpValues.add(speechSynthesises[0].getCurrentLevel()) return tmpValues } }