mirror of
https://github.com/hardillb/node-red-alexa-home-skill-web.git
synced 2025-12-13 10:29:43 +01:00
Getting things clean for AWS
Just checking in a bunch of little changes ahead of moving the whole stack over to AWS from Bluemix
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,3 +1,4 @@
|
|||||||
node_modules/*
|
node_modules/*
|
||||||
|
|
||||||
test.sh
|
test.sh
|
||||||
|
test-aws.sh
|
||||||
|
|||||||
8
index.js
8
index.js
@@ -412,7 +412,7 @@ app.post('/lostPassword', function(req, res, next){
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
app.get('/auth/start',oauthServer.authorize(function(applicationID, redirectURI,done){
|
app.get('/auth/start',oauthServer.authorize(function(applicationID, redirectURI, done) {
|
||||||
oauthModels.Application.findOne({ oauth_id: applicationID }, function(error, application) {
|
oauthModels.Application.findOne({ oauth_id: applicationID }, function(error, application) {
|
||||||
if (application) {
|
if (application) {
|
||||||
var match = false, uri = url.parse(redirectURI || '');
|
var match = false, uri = url.parse(redirectURI || '');
|
||||||
@@ -432,7 +432,7 @@ app.get('/auth/start',oauthServer.authorize(function(applicationID, redirectURI,
|
|||||||
} else {
|
} else {
|
||||||
done(error);
|
done(error);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}),function(req,res){
|
}),function(req,res){
|
||||||
var scopeMap = {
|
var scopeMap = {
|
||||||
// ... display strings for all scope variables ...
|
// ... display strings for all scope variables ...
|
||||||
@@ -453,7 +453,9 @@ app.get('/auth/start',oauthServer.authorize(function(applicationID, redirectURI,
|
|||||||
});
|
});
|
||||||
|
|
||||||
app.post('/auth/finish',function(req,res,next) {
|
app.post('/auth/finish',function(req,res,next) {
|
||||||
//console.log("/auth/finish user: ", req.user);
|
console.log("/auth/finish user: ", req.user);
|
||||||
|
console.log(req.body);
|
||||||
|
console.log(req.params);
|
||||||
if (req.user) {
|
if (req.user) {
|
||||||
next();
|
next();
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -35,7 +35,8 @@ var AccessTokenSchema = new Schema({
|
|||||||
scope: [ { type: String }],
|
scope: [ { type: String }],
|
||||||
expires: { type: Date, default: function(){
|
expires: { type: Date, default: function(){
|
||||||
var today = new Date();
|
var today = new Date();
|
||||||
var length = 60 * 24 * 90; // Length (in minutes) of our access token
|
//var length = 60 * 24 * 90; // Length (in minutes) of our access token
|
||||||
|
var length = 60 * 24 * 365 * 100;
|
||||||
return new Date(today.getTime() + length*60000);
|
return new Date(today.getTime() + length*60000);
|
||||||
} },
|
} },
|
||||||
active: { type: Boolean, get: function(value) {
|
active: { type: Boolean, get: function(value) {
|
||||||
|
|||||||
2
oauth.js
2
oauth.js
@@ -1,4 +1,4 @@
|
|||||||
var oauth2orize = require('oauth2orize');
|
var oauth2orize = require('oauth2orize');
|
||||||
var OAuth = require('./models/oauth');
|
var OAuth = require('./models/oauth');
|
||||||
|
|
||||||
var server = oauth2orize.createServer();
|
var server = oauth2orize.createServer();
|
||||||
|
|||||||
@@ -24,25 +24,37 @@ body {
|
|||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.device {
|
.devicerow {
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
margin: 1px;
|
margin: 1px;
|
||||||
border: 1px solid;
|
border: 1px solid;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device {
|
||||||
|
display: flex;
|
||||||
}
|
}
|
||||||
|
|
||||||
.deviceName {
|
.deviceName {
|
||||||
float: left;
|
flex-shrink: 0;
|
||||||
|
flex-basis: 200px;
|
||||||
width: 200px;
|
width: 200px;
|
||||||
|
order: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.deviceDescription {
|
.deviceDescription {
|
||||||
float: left;
|
flex-shrink: 0;
|
||||||
|
flex-basis: 400px;
|
||||||
width: 400px;
|
width: 400px;
|
||||||
|
order: 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.deviceActions {
|
||||||
|
order: 3;
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*.deviceActions {
|
|
||||||
width: 200px;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
.action {
|
.action {
|
||||||
padding: 1px;
|
padding: 1px;
|
||||||
@@ -79,4 +91,13 @@ body {
|
|||||||
margin-left: 80px;
|
margin-left: 80px;
|
||||||
width: 75px;
|
width: 75px;
|
||||||
height: 20px;
|
height: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
fieldset.action {
|
||||||
|
border-style: solid;
|
||||||
|
border-width: 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toggle {
|
||||||
|
cursor: context-menu;
|
||||||
}
|
}
|
||||||
BIN
static/images/decrementColorTemperature.png
Normal file
BIN
static/images/decrementColorTemperature.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 846 B |
BIN
static/images/incrementColorTemperature.png
Normal file
BIN
static/images/incrementColorTemperature.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 863 B |
BIN
static/images/setColor.png
Normal file
BIN
static/images/setColor.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.0 KiB |
BIN
static/images/setColorTemperature.png
Normal file
BIN
static/images/setColorTemperature.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 832 B |
28
static/js/zxcvbn.js
Normal file
28
static/js/zxcvbn.js
Normal file
File diff suppressed because one or more lines are too long
@@ -32,7 +32,7 @@ passport.use(new OAuth2Strategy({
|
|||||||
authorizationURL: 'https://localhost:3000/auth/start',
|
authorizationURL: 'https://localhost:3000/auth/start',
|
||||||
tokenURL: 'https://localhost:3000/auth/exchange',
|
tokenURL: 'https://localhost:3000/auth/exchange',
|
||||||
clientID: '2',
|
clientID: '2',
|
||||||
clientSecret: 'password1234',
|
clientSecret: 'foobar',
|
||||||
scope: "access_devices",
|
scope: "access_devices",
|
||||||
callbackURL: 'http://localhost:3001/callback'
|
callbackURL: 'http://localhost:3001/callback'
|
||||||
}, function(accessToken, refreshToken, profile, callback){
|
}, function(accessToken, refreshToken, profile, callback){
|
||||||
@@ -59,6 +59,8 @@ app.get('/start',passport.authenticate('oauth2'));
|
|||||||
app.get('/callback',
|
app.get('/callback',
|
||||||
function(req,res,next){
|
function(req,res,next){
|
||||||
console.log("callback");
|
console.log("callback");
|
||||||
|
console.log(req.body);
|
||||||
|
console.log(req.params);
|
||||||
next();
|
next();
|
||||||
},
|
},
|
||||||
passport.authenticate('oauth2', { failureRedirect: '/login' }),
|
passport.authenticate('oauth2', { failureRedirect: '/login' }),
|
||||||
|
|||||||
@@ -2,12 +2,13 @@
|
|||||||
<div class="container main-content">
|
<div class="container main-content">
|
||||||
<h1>Devices</h1>
|
<h1>Devices</h1>
|
||||||
<div class="deviceHeader">
|
<div class="deviceHeader">
|
||||||
<div class="deviceName"><strong>Name</strong></div>
|
<div style="width:200px; float:left" ><strong>Name</strong></div>
|
||||||
<div class="deviceDescription"><strong>Description</strong></div>
|
<div style="width:400px; float:left"><strong>Description</strong></div>
|
||||||
<div class="deviceActions"><strong>Actions</strong></div>
|
<div class="deviceActions"><strong>Actions</strong></div>
|
||||||
</div>
|
</div>
|
||||||
<% devices.forEach(function(device){ %>
|
<% devices.forEach(function(device){ %>
|
||||||
<div class="device">
|
<div class="deviceRow">
|
||||||
|
<div class="device">
|
||||||
<div class="deviceName"><%= device.friendlyName %></div>
|
<div class="deviceName"><%= device.friendlyName %></div>
|
||||||
<div class="deviceDescription"><%= device.friendlyDescription %></div>
|
<div class="deviceDescription"><%= device.friendlyDescription %></div>
|
||||||
<div class="deviceActions">
|
<div class="deviceActions">
|
||||||
@@ -15,8 +16,11 @@
|
|||||||
<img class="action" src="/images/<%= action %>.png" title="<%= action %>">
|
<img class="action" src="/images/<%= action %>.png" title="<%= action %>">
|
||||||
<% }); %>
|
<% }); %>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
<button onclick="edit('<%= device._id %>')">Edit</button>
|
<button onclick="edit('<%= device._id %>')">Edit</button>
|
||||||
<button onclick="deleteDevice('<%= device._id%>')">Delete</button>
|
<button onclick="deleteDevice('<%= device._id%>')">Delete</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<% }); %>
|
<% }); %>
|
||||||
<div style="padding-top: 10px;">
|
<div style="padding-top: 10px;">
|
||||||
@@ -32,16 +36,16 @@
|
|||||||
<input id="friendlyName" type="text">
|
<input id="friendlyName" type="text">
|
||||||
<label for="friendlyDescription">Description: </label>
|
<label for="friendlyDescription">Description: </label>
|
||||||
<br>
|
<br>
|
||||||
<textarea id="friendlyDescription" rows="2"></textarea>
|
<textarea id="friendlyDescription" rows="2" style="width: 95%"></textarea>
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend>Actions</legend>
|
<legend>Actions</legend>
|
||||||
<fieldset id="onOff">
|
<fieldset class="action" id="onOff">
|
||||||
<label for="turnOn">On: </label>
|
<label for="turnOn">On: </label>
|
||||||
<input title="Turn device on" type="checkbox" name="actions" id="turnOn" value="turnOn">
|
<input title="Turn device on" type="checkbox" name="actions" id="turnOn" value="turnOn">
|
||||||
<label for="turnOff">Off: </label>
|
<label for="turnOff">Off: </label>
|
||||||
<input title="Turn device off" type="checkbox" name="actions" id="turnOff" value="turnOff">
|
<input title="Turn device off" type="checkbox" name="actions" id="turnOff" value="turnOff">
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<fieldset id="percentCheck">
|
<fieldset class="action" id="percentCheck">
|
||||||
<label for="setPercentage">%: </label>
|
<label for="setPercentage">%: </label>
|
||||||
<input title="Set device %" type="checkbox" name="actions" id="setPercentage" value="setPercentage" onclick='checkCapability(this)'>
|
<input title="Set device %" type="checkbox" name="actions" id="setPercentage" value="setPercentage" onclick='checkCapability(this)'>
|
||||||
<label for="incrementPercentage">+%: </label>
|
<label for="incrementPercentage">+%: </label>
|
||||||
@@ -49,7 +53,7 @@
|
|||||||
<label for="decrementPercentage">-%: </label>
|
<label for="decrementPercentage">-%: </label>
|
||||||
<input title="Turn device down" type="checkbox" name="actions" id="decrementPercentage" value="decrementPercentage" onclick='checkCapability(this)'>
|
<input title="Turn device down" type="checkbox" name="actions" id="decrementPercentage" value="decrementPercentage" onclick='checkCapability(this)'>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<fieldset id="temperatureCheck">
|
<fieldset class="action" id="temperatureCheck">
|
||||||
<label for="setTargetTemperature">°C/F: </label>
|
<label for="setTargetTemperature">°C/F: </label>
|
||||||
<input title="Set target temperature" type="checkbox" name="actions" id="setTargetTemperature" value="setTargetTemperature" onclick='checkCapability(this)'>
|
<input title="Set target temperature" type="checkbox" name="actions" id="setTargetTemperature" value="setTargetTemperature" onclick='checkCapability(this)'>
|
||||||
<label for="incrementTargetTemperature">+°C/F: </label>
|
<label for="incrementTargetTemperature">+°C/F: </label>
|
||||||
@@ -58,14 +62,14 @@
|
|||||||
<input title="Turn target temperature down" type="checkbox" name="actions" id="decrementTargetTemperature" value="decrementTargetTemperature" onclick='checkCapability(this)'>
|
<input title="Turn target temperature down" type="checkbox" name="actions" id="decrementTargetTemperature" value="decrementTargetTemperature" onclick='checkCapability(this)'>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<!-- -->
|
<!-- -->
|
||||||
<fieldset id="queryTemperature">
|
<fieldset class="action" id="queryTemperature">
|
||||||
<label for="getTargetTemperature">Query Set Point: </label>
|
<label for="getTargetTemperature">Query Set Point: </label>
|
||||||
<input title="Query target temperature" type="checkbox" name="actions" id="getTargetTemperature" value="getTargetTemperature" onclick='checkCapability(this)'>
|
<input title="Query target temperature" type="checkbox" name="actions" id="getTargetTemperature" value="getTargetTemperature" onclick='checkCapability(this)'>
|
||||||
<br/>
|
<br/>
|
||||||
<label ofr="getTemperatureReading">Query Current Temp: </label>
|
<label ofr="getTemperatureReading">Query Current Temp: </label>
|
||||||
<input title="Query current temperature" type="checkbox" name="actions" id="getTemperatureReading" value="getTemperatureReading" onclick='checkCapability(this)'>
|
<input title="Query current temperature" type="checkbox" name="actions" id="getTemperatureReading" value="getTemperatureReading" onclick='checkCapability(this)'>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<fieldset id="lockControl">
|
<fieldset class="action" id="lockControl">
|
||||||
<label for="">Lock/Unlock</label>
|
<label for="">Lock/Unlock</label>
|
||||||
<input title="Lock or Unlock" type="checkbox" name="actions" id="setLockState" value="setLockState" onclick='checkCapability(this)'>
|
<input title="Lock or Unlock" type="checkbox" name="actions" id="setLockState" value="setLockState" onclick='checkCapability(this)'>
|
||||||
<br/>
|
<br/>
|
||||||
@@ -73,6 +77,17 @@
|
|||||||
<input title="Query Lock state" type="checkbox" name="actions" id="getLockState" value="getLockState" onclick='checkCapability(this)'>
|
<input title="Query Lock state" type="checkbox" name="actions" id="getLockState" value="getLockState" onclick='checkCapability(this)'>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<!-- -->
|
<!-- -->
|
||||||
|
<fieldset class="action" id="lighting">
|
||||||
|
<label for="setColor">Set Color</label>
|
||||||
|
<input title="Set Color" type="checkbox" name="actions" id="setColor" value="setColor" onclick='checkCapability(this)'>
|
||||||
|
<br/>
|
||||||
|
<label for="setColorTemperature">Set Color Temperature</label>
|
||||||
|
<input title="Set Color Temperature" type="checkbox" name="actions" id="setColorTemperature" value="setColorTemperature" onclick='checkCapability(this)'>
|
||||||
|
<label for="incrementColorTemperature">Increment Color Temperature</label>
|
||||||
|
<input title="Increment Color Temperature" type="checkbox" name="actions" id="incrementColorTemperature" value="incrementColorTemperature" onclick='checkCapability(this)'>
|
||||||
|
<label for="decrementColorTemperature">Decrement Color Temperature</label>
|
||||||
|
<input title="Decrement Color Temperature" type="checkbox" name="actions" id="decrementColorTemperature" value="decrementColorTemperature" onclick='checkCapability(this)'>
|
||||||
|
</fieldset>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -176,6 +191,7 @@
|
|||||||
|
|
||||||
function addDevice() {
|
function addDevice() {
|
||||||
clearDevice();
|
clearDevice();
|
||||||
|
checkCapability();
|
||||||
$("#dialog").dialog("open");
|
$("#dialog").dialog("open");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -236,13 +252,21 @@
|
|||||||
|
|
||||||
var l = lock | qLock;
|
var l = lock | qLock;
|
||||||
|
|
||||||
if (p & t || p & l || t & l) {
|
var color = $('#setColor').prop('checked');
|
||||||
alert("You can not control percentage and temperature, percentage and lock or temperature and lock on the same device");
|
var colorTemp = $('#setColorTemp').prop('checked');
|
||||||
|
var incColorTemp = $('#incrementColorTemp').prop('checked');
|
||||||
|
var decColorTemp = $('#decrementColorTemp').prop('checked');
|
||||||
|
|
||||||
|
var c = color | colorTemp | incColorTemp | decColorTemp;
|
||||||
|
|
||||||
|
if (p & t || p & l || t & l || t & c || l & c) {
|
||||||
|
alert("You can not control percentage and temperature, percentage and lock, temperature and lock or temperatur and color or lock and color on the same device");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (p) {
|
if (p) {
|
||||||
$('#percentCheck').removeAttr('disabled');
|
$('#percentCheck').removeAttr('disabled');
|
||||||
|
$('#lighting').removeAttr('disabled');
|
||||||
$('#temperatureCheck').attr('disabled', '');
|
$('#temperatureCheck').attr('disabled', '');
|
||||||
$('#queryTemperature').attr('disabled', '');
|
$('#queryTemperature').attr('disabled', '');
|
||||||
$('#lockControl').attr('disabled', '');
|
$('#lockControl').attr('disabled', '');
|
||||||
@@ -251,16 +275,25 @@
|
|||||||
$('#queryTemperature').removeAttr('disabled');
|
$('#queryTemperature').removeAttr('disabled');
|
||||||
$('#lockControl').attr('disabled', '');
|
$('#lockControl').attr('disabled', '');
|
||||||
$('#percentCheck').attr('disabled', '');
|
$('#percentCheck').attr('disabled', '');
|
||||||
|
$('#lighting').attr('disabled', '');
|
||||||
} else if (l) {
|
} else if (l) {
|
||||||
$('#lockControl').removeAttr('disabled');
|
$('#lockControl').removeAttr('disabled');
|
||||||
$('#temperatureCheck').attr('disabled', '');
|
$('#temperatureCheck').attr('disabled', '');
|
||||||
$('#queryTemperature').attr('disabled', '');
|
$('#queryTemperature').attr('disabled', '');
|
||||||
$('#percentCheck').attr('disabled', '');
|
$('#percentCheck').attr('disabled', '');
|
||||||
|
$('#lighting').attr('disabled', '');
|
||||||
|
} else if (c) {
|
||||||
|
$('#percentCheck').removeAttr('disabled');
|
||||||
|
$('#lighting').removeAttr('disabled');
|
||||||
|
$('#lockControl').attr('disabled', '');
|
||||||
|
$('#temperatureCheck').attr('disabled', '');
|
||||||
|
$('#queryTemperature').attr('disabled', '');
|
||||||
} else {
|
} else {
|
||||||
$('#percentCheck').removeAttr('disabled');
|
$('#percentCheck').removeAttr('disabled');
|
||||||
$('#temperatureCheck').removeAttr('disabled');
|
$('#temperatureCheck').removeAttr('disabled');
|
||||||
$('#queryTemperature').removeAttr('disabled');
|
$('#queryTemperature').removeAttr('disabled');
|
||||||
$('#lockControl').removeAttr('disabled');
|
$('#lockControl').removeAttr('disabled');
|
||||||
|
$('#lighting').removeAttr('disabled');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ npm install node-red-contrib-alexa-home-skill</pre>
|
|||||||
|
|
||||||
<h2 id="buildFlows">Building Flows</h2>
|
<h2 id="buildFlows">Building Flows</h2>
|
||||||
<h3>Alexa Home</h3>
|
<h3>Alexa Home</h3>
|
||||||
<p>The Alexa Home node outputs a message that looks like this:</p>
|
<!-- <p>The Alexa Home node outputs a message that looks like this:</p>
|
||||||
|
|
||||||
<pre>{
|
<pre>{
|
||||||
_messageId: 'd6734865-6a96-4967-8504-6056e75ba5c3',
|
_messageId: 'd6734865-6a96-4967-8504-6056e75ba5c3',
|
||||||
@@ -113,25 +113,163 @@ npm install node-red-contrib-alexa-home-skill</pre>
|
|||||||
"extraInfo": {},
|
"extraInfo": {},
|
||||||
payload: -5
|
payload: -5
|
||||||
}</pre>
|
}</pre>
|
||||||
<p>The important bits are the <i>msg.command</i> and the <i>msg.payload</i>. The <i>msg.command</i> will be one of the following list (that corresponds to the capabilities you added to the device when you defined it):</p>
|
<p>The important bits are the <i>msg.command</i> and the <i>msg.payload</i>. The <i>msg.command</i> will be one of the following list (that corresponds to the capabilities you added to the device when you defined it):</p> -->
|
||||||
|
|
||||||
|
<p>The Alexa Home node supports the following commands, click on the command name to see a sample output message or toggle all by clicking <span data-toggle="collapse" data-target=".collapse" >here</span>:</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>TurnOnRequest</li>
|
<li><span class="toggle" data-toggle="collapse" data-target="#TurnOnRequest">TurnOnRequest</span>
|
||||||
<li>TurnOffRequest</li>
|
<div id="TurnOnRequest" class="collapse">
|
||||||
<li>SetPercentageRequest</li>
|
<pre>{
|
||||||
<li>IncrementPercentageRequest</li>
|
'_messageId': 'd6734865-6a96-4967-8504-6056e75ba5c3',
|
||||||
<li>DecrementPercentageRequest</li>
|
'_applianceId': '3',
|
||||||
<li>SetTargetTemperatureRequest</li>
|
'_confId': 'cc670790.9f0eb8',
|
||||||
<li>IncrementTargetTemperatureRequest</li>
|
'command': 'TurnOnRequest',
|
||||||
<li>DecrementTargetTemperatureRequest</li>
|
'extraInfo': {},
|
||||||
<li>GetTemperatureReadingRequest <sup>1,2</sup></li>
|
'payload': true
|
||||||
<li>GetTargetTemperatureRequests <sup>1,2</sup></li>
|
}</pre>
|
||||||
<li>SetLockState <sup>1</sup></li>
|
</div>
|
||||||
<li>GetLockState <sup>1,2</sup></li>
|
</li>
|
||||||
|
<li><span class="toggle" data-toggle="collapse" data-target="#TurnOffRequest">TurnOffRequest</span>
|
||||||
|
<div id="TurnOffRequest" class="collapse">
|
||||||
|
<pre>{
|
||||||
|
'_messageId': 'd6734865-6a96-4967-8504-6056e75ba5c3',
|
||||||
|
'_applianceId': '3',
|
||||||
|
'_confId': 'cc670790.9f0eb8',
|
||||||
|
'command': 'TurnOffRequest',
|
||||||
|
'extraInfo': {},
|
||||||
|
'payload': true
|
||||||
|
}</pre>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li><span class="toggle" data-toggle="collapse" data-target="#SetPercentageRequest">SetPercentageRequest</span>
|
||||||
|
<div id="SetPercentageRequest" class="collapse">
|
||||||
|
<pre>{
|
||||||
|
'_messageId': 'd6734865-6a96-4967-8504-6056e75ba5c3',
|
||||||
|
'_applianceId': '3',
|
||||||
|
'_confId': 'cc670790.9f0eb8',
|
||||||
|
'command': 'SetPercentageRequest',
|
||||||
|
'extraInfo': {},
|
||||||
|
'payload': 50
|
||||||
|
}</pre>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li><span class="toggle" data-toggle="collapse" data-target="#IncrementPercentageRequest">IncrementPercentageRequest</span>
|
||||||
|
<div id="IncrementPercentageRequest" class="collapse">
|
||||||
|
<pre>{
|
||||||
|
'_messageId': 'd6734865-6a96-4967-8504-6056e75ba5c3',
|
||||||
|
'_applianceId': '3',
|
||||||
|
'_confId': 'cc670790.9f0eb8',
|
||||||
|
'command': 'IncrementPercentageRequest',
|
||||||
|
'extraInfo': {},
|
||||||
|
'payload': 10
|
||||||
|
}</pre>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li><span class="toggle" data-toggle="collapse" data-target="#DecrementPercentageRequest">DecrementPercentageRequest</span>
|
||||||
|
<div id="DecrementPercentageRequest" class="collapse">
|
||||||
|
<pre>{
|
||||||
|
'_messageId': 'd6734865-6a96-4967-8504-6056e75ba5c3',
|
||||||
|
'_applianceId': '3',
|
||||||
|
'_confId': 'cc670790.9f0eb8',
|
||||||
|
'command': 'DecrementPercentageRequest',
|
||||||
|
'extraInfo': {},
|
||||||
|
'payload': -10
|
||||||
|
}</pre>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li><span class="toggle" data-toggle="collapse" data-target="#SetTargetTemperatureRequest">SetTargetTemperatureRequest<span>
|
||||||
|
<div id="SetTargetTemperatureRequest" class="collapse">
|
||||||
|
<pre>{
|
||||||
|
'_messageId': 'd6734865-6a96-4967-8504-6056e75ba5c3',
|
||||||
|
'_applianceId': '3',
|
||||||
|
'_confId': 'cc670790.9f0eb8',
|
||||||
|
'command': 'SetTargetTemperatureRequest',
|
||||||
|
'extraInfo': {},
|
||||||
|
'payload': 22
|
||||||
|
}</pre>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li><span class="toggle" data-toggle="collapse" data-target="#IncrementTargetTemperatureRequest">IncrementTargetTemperatureRequest</span>
|
||||||
|
<div id="IncrementTargetTemperatureRequest" class="collapse">
|
||||||
|
<pre>{
|
||||||
|
'_messageId': 'd6734865-6a96-4967-8504-6056e75ba5c3',
|
||||||
|
_applianceId': '3',
|
||||||
|
'_confId': 'cc670790.9f0eb8',
|
||||||
|
'command': 'IncrementTargetTemperatureRequest',
|
||||||
|
'extraInfo': {},
|
||||||
|
'payload': 5
|
||||||
|
}</pre>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li><span class="toggle" data-toggle="collapse" data-target="#DecrementTargetTemperatureRequest">DecrementTargetTemperatureRequest</span>
|
||||||
|
<div id="DecrementTargetTemperatureRequest" class="collapse">
|
||||||
|
<pre>{
|
||||||
|
'_messageId': 'd6734865-6a96-4967-8504-6056e75ba5c3',
|
||||||
|
'_applianceId': '3',
|
||||||
|
'_confId': 'cc670790.9f0eb8',
|
||||||
|
'command': 'DecrementTargetTemperatureRequest',
|
||||||
|
'extraInfo': {},
|
||||||
|
'payload': -5
|
||||||
|
}</pre>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li><span class="toggle" data-toggle="collapse" data-target="#GetTemperatureReadingRequest">GetTemperatureReadingRequest <sup>2,3</sup></span>
|
||||||
|
<div id="GetTemperatureReadingRequest" class="collapse">
|
||||||
|
<pre>{
|
||||||
|
'_messageId': 'd6734865-6a96-4967-8504-6056e75ba5c3',
|
||||||
|
'_applianceId': '3',
|
||||||
|
'_confId': 'cc670790.9f0eb8',
|
||||||
|
'command': 'GetTemperatureReadingRequest',
|
||||||
|
'extraInfo': {}
|
||||||
|
}</pre>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li><span class="toggle" data-toggle="collapse" data-target="#GetTargetTemperatureRequests">GetTargetTemperatureRequests <sup>2,3</sup></span>
|
||||||
|
<div id="GetTargetTemperatureRequests" class="collapse">
|
||||||
|
<pre>{
|
||||||
|
'_messageId': 'd6734865-6a96-4967-8504-6056e75ba5c3',
|
||||||
|
'_applianceId': '3',
|
||||||
|
'_confId': 'cc670790.9f0eb8',
|
||||||
|
'command': 'GetTargetTemperatureRequests',
|
||||||
|
'extraInfo': {}
|
||||||
|
}</pre>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li><span class="toggle" data-toggle="collapse" data-target="#SetLockState">SetLockState <sup>1</sup></span>
|
||||||
|
<div id="SetLockState" class="collapse">
|
||||||
|
<pre>{
|
||||||
|
'_messageId': 'd6734865-6a96-4967-8504-6056e75ba5c3',
|
||||||
|
'_applianceId': '3',
|
||||||
|
'_confId': 'cc670790.9f0eb8',
|
||||||
|
'command': 'SetLockState',
|
||||||
|
'extraInfo': {},
|
||||||
|
'payload': 'LOCKED'
|
||||||
|
}</pre>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li><span class="toggle" data-toggle="collapse" data-target="#GetLockState">GetLockState <sup>1,3</sup></span>
|
||||||
|
<div id="GetLockState" class="collapse">
|
||||||
|
<pre>{
|
||||||
|
'_messageId': 'd6734865-6a96-4967-8504-6056e75ba5c3',
|
||||||
|
'_applianceId': '3',
|
||||||
|
'_confId': 'cc670790.9f0eb8',
|
||||||
|
'command': 'GetLockState',
|
||||||
|
'extraInfo': {}
|
||||||
|
}</pre>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<!--
|
||||||
|
<li>SetColorRequest <sup>1</sup></li>
|
||||||
|
<li>SetColorTemperatureRequest <sup>1</sup></li>
|
||||||
|
<li>IncrementColorTemperatureRequest <sup>1,3</sup></li>
|
||||||
|
<li>DecrementColorTemperatureRequest <sup>1,3</sup></li>
|
||||||
|
-->
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<ol>
|
<ol>
|
||||||
<li>Only available in to US users at the moment</li>
|
<li>Amazon documentation say only available to US users at the moment</li>
|
||||||
<li>Can not be Auto Acknoledged as they need to return a value</li>
|
<li>Amazon documentation say only available to US & UK users at the moment</li>
|
||||||
|
<li>Can not be Auto Acknowledged as they need to return a value</li>
|
||||||
</ol>
|
</ol>
|
||||||
|
|
||||||
<p>The payload field will hold positive numbers for the Set and Increment versions of commands and negative numbers
|
<p>The payload field will hold positive numbers for the Set and Increment versions of commands and negative numbers
|
||||||
@@ -212,7 +350,7 @@ npm install node-red-contrib-alexa-home-skill</pre>
|
|||||||
<p>This enforces a temperature range between 10°C and 30°C, sending the Alexa response to the second output and
|
<p>This enforces a temperature range between 10°C and 30°C, sending the Alexa response to the second output and
|
||||||
if the input is in range the control message is sent to the first function output. Note: All values are passed in Degrees
|
if the input is in range the control message is sent to the first function output. Note: All values are passed in Degrees
|
||||||
C even if the input voice commands are in Degrees F when using Alexa in the US.</p>
|
C even if the input voice commands are in Degrees F when using Alexa in the US.</p>
|
||||||
<p>A recent update added Lock support, Both the set and query can be answered with a <i>msg.extra</i> of either "LOCKED"
|
<p>A recent update added Lock support, Both the set and query can be answered with a <i>msg.extra.lockState</i> of either "LOCKED"
|
||||||
or "UNLOCKED" as follows:</p>
|
or "UNLOCKED" as follows:</p>
|
||||||
<pre>{
|
<pre>{
|
||||||
lockState: "LOCKED"
|
lockState: "LOCKED"
|
||||||
|
|||||||
@@ -24,6 +24,9 @@
|
|||||||
<div>
|
<div>
|
||||||
|
|
||||||
<% if (user) { %>
|
<% if (user) { %>
|
||||||
|
<% if (errors) { %>
|
||||||
|
<p style="color: red"><%= errors %></p>
|
||||||
|
<% } %>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<p>Signed in as <strong><%= user.name%></strong>.</p>
|
<p>Signed in as <strong><%= user.name%></strong>.</p>
|
||||||
<a href="/logout?next=<%= currentURL %>">Not </a><%= user.username %>?
|
<a href="/logout?next=<%= currentURL %>">Not </a><%= user.username %>?
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
<div id="pwq" class="pwq"></div>
|
<div id="pwq" class="pwq"></div>
|
||||||
|
|
||||||
<p>Please enter password again</p>
|
<p>Please enter password again</p>
|
||||||
<label style="width: 75px" for="password">Password:</label>
|
<label style="width: 75px" for="passwordAgain">Password:</label>
|
||||||
<input type="password" id="passwordAgain"/>
|
<input type="password" id="passwordAgain"/>
|
||||||
<div id="pwm" class="pwq"></div>
|
<div id="pwm" class="pwq"></div>
|
||||||
<br>
|
<br>
|
||||||
|
|||||||
Reference in New Issue
Block a user