Commit a0708982 by Alex Rhodes

Added JavaDoc, Updated ReadMe

parent 3b9477cd
Thermostat for Echo
Copyright (C) 2016 Alex Rhodes
https://www.alexscottrhodes.com
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
Thermostat for Echo is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Nest®, Nest Learning Thermostat®, Nest Leaf Logo® and the Works with Nest logos are trademarks licensed by Nest Labs, Inc.
Echo, Alexa are trademarks licensed to Amazon.com, Inc. or its affiliates © 1996-2016
# Amazon Echo/Nest Learning Thermostat Control #
This source code is for an Amazon Echo "Alexa" skill to control the Nest Learning Thermostat. It was previously under the Amazon Skills and Works With Nest stores. Nest has released native integration with the Amazon Echo. I am releasing this skill because it will no longer be supported. It offers more features than the Nest version. If you are into using custom skill/alexa you can use this skill for your Echo.
##Set Up
###Requirements
* A Nest application (free from nest developer site) that allows you to get API access to your nest.
* General knowledge of Amazon Skill dev process.
Without going into detail about skill development etc.. This skill can be hosted in a Lambda function on AWS as typical of any skill. It requires that you enter the Alexa Skill Application ID in the request handle, and your Nest API Key in the nest functions class. Then you need to add a default thermostat ID that you want to use when you DO NOT specify a thermostat name. If you specify a thermostat name, it will get the ID from your home structure. (See below for supported commands etc.)
##Skill description
Full description of supported features here:
http://alexsrhodes.webfactional.com/misc/therm_legacy/echo_help.html
##Contact##
Please email me with any questions, I'm not going to guide you through skill development or using the Nest application etc. Tutorials are readily available for that on Amazon and Nest's developer sites.
Email: alexscottrhodes@gmail.com
\ No newline at end of file
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<!--
Thermostat for Echo
Copyright (C) 2016 Alex Rhodes
https://www.alexscottrhodes.com
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
Thermostat for Echo is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Nest®, Nest Learning Thermostat®, Nest Leaf Logo® and the Works with Nest logos are trademarks licensed by Nest Labs, Inc.
Echo, Alexa are trademarks licensed to Amazon.com, Inc. or its affiliates © 1996-2016
-->
<modelVersion>4.0.0</modelVersion>
<groupId>NestController</groupId>
<artifactId>Nest</artifactId>
<name>Nest for Echo </name>
<description>Control your Nest smart thermostat from your Amazon echo.</description>
<dependencies>
<!-- Nest Function and Echo Dependencies -->
......
/**
Thermostat for Echo
Copyright (C) 2016 Alex Rhodes
https://www.alexscottrhodes.com
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
Thermostat for Echo is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Nest, Nest Learning Thermostat, Nest Leaf Logo and the Works with Nest logos are trademarks licensed by Nest Labs, Inc.
Echo, Alexa are trademarks licensed to Amazon.com, Inc. or its affiliates 1996-2016
*/
package com.alexscottrhodes.nest;
import com.amazon.speech.speechlet.SpeechletResponse;
import com.amazon.speech.ui.PlainTextOutputSpeech;
/**
* This class handles the Nest error responses as documented in the Nest API documentation
* @author Alex Rhodes
*
*/
public class ErrorHandler {
/**
* Sends a failure response with a given message
* @param message a String of the message to provide with the failure response
* @return a SpeechletResponse with the failure message
*/
public static SpeechletResponse failed(String message){
PlainTextOutputSpeech speech = new PlainTextOutputSpeech();
speech.setText(message);
return SpeechletResponse.newTellResponse(speech);
}
/**
* Returns an informative message that handles the Nest error messages as described in the Nest API documentation
* @param message a String of the Nest failure response
* @return a SpeechletResponse with an informative message for the user to understand why a failure occured.
*/
public static SpeechletResponse nestFailureResponse(String message){
PlainTextOutputSpeech speech = new PlainTextOutputSpeech();
......
/**
Thermostat for Echo
Copyright (C) 2016 Alex Rhodes
https://www.alexscottrhodes.com
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
Thermostat for Echo is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Nest®, Nest Learning Thermostat®, Nest Leaf Logo® and the Works with Nest logos are trademarks licensed by Nest Labs, Inc.
Echo, Alexa are trademarks licensed to Amazon.com, Inc. or its affiliates © 1996-2016
*/
package com.alexscottrhodes.nest;
import java.util.HashSet;
import java.util.Set;
import com.amazon.speech.speechlet.lambda.SpeechletRequestStreamHandler;
/**
* Handles the Alexa Skill Service request
* @author Alex Rhodes
*
*/
public final class NestRequestHandler extends SpeechletRequestStreamHandler {
private static final Set<String> supportedApplicationIds = new HashSet<String>();
private static final Set<String> supportedApplicationIds = new HashSet<String>();
static {
//Actual:
/**
* Your Amazon application ID must be provided here
*/
supportedApplicationIds.add("<Amazon application ID here>");
}
/**
* Instantiates a nest speechlet with the given application IDs
*/
public NestRequestHandler() {
super(new NestSpeechlet(), supportedApplicationIds);
}
......
/**
Thermostat for Echo
Copyright (C) 2016 Alex Rhodes
https://www.alexscottrhodes.com
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
Thermostat for Echo is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Nest, Nest Learning Thermostat, Nest Leaf Logo and the Works with Nest logos are trademarks licensed by Nest Labs, Inc.
Echo, Alexa are trademarks licensed to Amazon.com, Inc. or its affiliates 1996-2016
*/
package com.alexscottrhodes.nest;
import com.alexscottrhodes.actions.NestFunctions;
......@@ -10,11 +35,8 @@ import com.amazon.speech.speechlet.SessionStartedRequest;
import com.amazon.speech.speechlet.Speechlet;
import com.amazon.speech.speechlet.SpeechletException;
import com.amazon.speech.speechlet.SpeechletResponse;
import com.amazon.speech.speechlet.User;
import com.amazon.speech.ui.LinkAccountCard;
import com.amazon.speech.ui.PlainTextOutputSpeech;
import com.amazon.speech.ui.Reprompt;
import com.amazon.speech.ui.SimpleCard;
public class NestSpeechlet implements Speechlet{
......
Thermostat for Echo
Copyright (C) 2016 Alex Rhodes
https://www.alexscottrhodes.com
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
Thermostat for Echo is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Use Below:
{
"intents": [
{
......
Thermostat for Echo
Copyright (C) 2016 Alex Rhodes
https://www.alexscottrhodes.com
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
Thermostat for Echo is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Use below:
NestSpecIntent {DIRECTION} {DEGREES} degrees
NestSpecIntent {DIRECTION} {DEGREES}
NestSpecIntent {DIRECTION} the temperature {DEGREES} degrees
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment