mirror of
https://github.com/mtan93/SmartThingsPublic.git
synced 2026-03-08 05:31:56 +00:00
Merge pull request #633 from tslagle13/tts-fixes
Fix text-to-speech feature
This commit is contained in:
@@ -76,7 +76,7 @@ def mainPage() {
|
||||
}
|
||||
section{
|
||||
input "actionType", "enum", title: "Action?", required: true, defaultValue: "Bell 1", options: [
|
||||
//"Custom Message",
|
||||
"Custom Message",
|
||||
"Bell 1",
|
||||
"Bell 2",
|
||||
"Dogs Barking",
|
||||
@@ -89,7 +89,7 @@ def mainPage() {
|
||||
"Someone is arriving",
|
||||
"Piano",
|
||||
"Lightsaber"]
|
||||
//input "message","text",title:"Play this message", required:false, multiple: false
|
||||
input "message","text",title:"Play this message", required:false, multiple: false
|
||||
}
|
||||
section {
|
||||
input "sonos", "capability.musicPlayer", title: "On this Speaker player", required: true
|
||||
@@ -408,13 +408,15 @@ private loadText() {
|
||||
case "Lightsaber":
|
||||
state.sound = [uri: "http://s3.amazonaws.com/smartapp-media/sonos/lightsaber.mp3", duration: "10"]
|
||||
break;
|
||||
default:
|
||||
/*if (message) {
|
||||
case "Custom Message":
|
||||
if (message) {
|
||||
state.sound = textToSpeech(message instanceof List ? message[0] : message) // not sure why this is (sometimes) needed)
|
||||
}
|
||||
else {
|
||||
state.sound = textToSpeech("You selected the custom message option but did not enter a message in the $app.label Smart App")
|
||||
}*/
|
||||
}
|
||||
break;
|
||||
default:
|
||||
state.sound = [uri: "http://s3.amazonaws.com/smartapp-media/sonos/bell1.mp3", duration: "10"]
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user