Disable KeepAlive on proxy (#21)

* Service lookup

* Disable KeepAlive to force RR for replias.

* set KeepAlive to 0

* Remove temporary file

* Support white and rename function

* Remove debug from node sample
This commit is contained in:
Alex Ellis
2017-03-21 08:39:36 +00:00
committed by GitHub
parent 9cf4376096
commit 2aeadfda1c
9 changed files with 201 additions and 119 deletions

View File

@ -12,7 +12,6 @@ getStdin().then(content => {
});
function tellWithCard(speechOutput, request) {
// console.log(sample)
sample.response.session = request.session;
sample.response.outputSpeech.text = speechOutput;
sample.response.card.content = speechOutput;
@ -23,8 +22,6 @@ function tellWithCard(speechOutput, request) {
}
function handle(request, intent) {
// console.log("Intent: " + intent.name);
if(intent.name == "TurnOffIntent") {
let req = {r:0,g:0,b:0};
var speechOutput = "Lights off.";
@ -40,12 +37,15 @@ function handle(request, intent) {
req.b = 255;
} else if (colorRequested == "green") {
req.g = 255;
} else if (colorRequested == "white") {
req.r = 255;
req.g = 103;
req.b = 23;
} else {
let msg = "I heard "+colorRequested+ " but can only show: red, green, blue and white.";
return tellWithCard(msg, request);
}
else {
return tellWithCard("I heard "+colorRequested+
" but can only do: red, green, blue.",
"I heard "+colorRequested+ " but can only do: red, green, blue.", request);
}
sendColor.sendColor(req, () => {
var speechOutput = "OK, " + colorRequested + ".";
return tellWithCard(speechOutput, request);