-
Notifications
You must be signed in to change notification settings - Fork 4
Conversation
thermostats/Salus.js
Outdated
|
||
async logout() { | ||
console.log('Logging out...'); | ||
await request.get(this.urlTo('logout', false), { jar: this._jar}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected an assignment or function call and instead saw an expression.
Missing semicolon.
await request.post(`${host}/includes/set.php`, options); | ||
} | ||
|
||
async logout() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Class properties must be methods. Expected '(' but instead saw 'logout'.
Duplicate class method 'async'.
}; | ||
|
||
await request.post(`${host}/includes/set.php`, form); | ||
await request.post(`${host}/includes/set.php`, options); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'template literal syntax' is only available in ES6 (use 'esversion: 6').
Expected an assignment or function call and instead saw an expression.
Missing semicolon.
console.log(`Setting temp: ${t}...`); | ||
let form = { | ||
let options = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'let' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
@@ -79,19 +79,25 @@ class Salus { | |||
} | |||
|
|||
async setTemperature(temp) { | |||
let t = parseFloat(temp).toFixed(1); | |||
let t = temp.toFixed(1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'let' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
const handler = async (event) => { | ||
console.log(event); | ||
let onOff = event.queryResult.parameters.onOff; | ||
let duration = event.queryResult.parameters.duration.amount; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'let' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
|
||
const handler = async (event) => { | ||
console.log(event); | ||
let onOff = event.queryResult.parameters.onOff; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'let' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
}; | ||
|
||
const handler = async (event) => { | ||
console.log(event); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'arrow function syntax (=>)' is only available in ES6 (use 'esversion: 6').
Expected ')' to match '{' from line 40 and instead saw '.'.
return m; | ||
}; | ||
|
||
const handler = async (event) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
Expected '(' and instead saw '{'.
const say = (messages) => { | ||
var m = ''; | ||
if (messages instanceof Array) { | ||
for (const message of messages) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
'for of' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
return { | ||
fulfillmentText: say(e) | ||
}; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrecoverable syntax error. (92% scanned).
}; | ||
|
||
const handler = async (event) => { | ||
console.log(event); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'arrow function syntax (=>)' is only available in ES6 (use 'esversion: 6').
Expected ')' to match '{' from line 22 and instead saw '.'.
const Factory = require('../thermostats/Factory'); | ||
|
||
const say = (messages) => { | ||
let m = ''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'let' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
const ControlService = require('../core/ControlService'); | ||
const Factory = require('../thermostats/Factory'); | ||
|
||
const say = (messages) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'arrow function syntax (=>)' is only available in ES6 (use 'esversion: 6').
'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
const AwsHoldStrategy = require('../aws/HoldStrategy'); | ||
const DefaultHoldStrategy = require('../core/HoldStrategy'); | ||
const ControlService = require('../core/ControlService'); | ||
const Factory = require('../thermostats/Factory'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
} | ||
}, | ||
defaultOnTemp: parseFloat(process.env.DEFAULT_ON_TEMP || '20'), | ||
defaultOffTemp: parseFloat(process.env.DEFAULT_OFF_TEMP || '14'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'process' is not defined.
@@ -13,7 +13,10 @@ class ThermostatRepository { | |||
options: { | |||
username: process.env.USERNAME, | |||
password: process.env.PASSWORD | |||
} | |||
}, | |||
defaultOnTemp: parseFloat(process.env.DEFAULT_ON_TEMP || '20'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'process' is not defined.
let messages = []; | ||
messages.push(`The current temperature is ${this.speakTemperature(device.currentTemperature)} degrees.`); | ||
messages.push(`The target is ${this.speakTemperature(device.targetTemperature)} degrees.`); | ||
await this.determineIfHolding(device, messages); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected an assignment or function call and instead saw an expression.
Too many errors. (33% scanned).
|
||
let messages = []; | ||
messages.push(`The current temperature is ${this.speakTemperature(device.currentTemperature)} degrees.`); | ||
messages.push(`The target is ${this.speakTemperature(device.targetTemperature)} degrees.`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'template literal syntax' is only available in ES6 (use 'esversion: 6').
this.verifyContactable(device); | ||
|
||
let messages = []; | ||
messages.push(`The current temperature is ${this.speakTemperature(device.currentTemperature)} degrees.`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'template literal syntax' is only available in ES6 (use 'esversion: 6').
b4155bc
to
27c78d3
Compare
@@ -35,6 +35,7 @@ class ThermostatRepository { | |||
|
|||
let response = await this.client.get(params).promise(); | |||
if (response.Item) { | |||
console.log(`Found thermostat for user ${userId} with username ${response.Item.options.username}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'console' is not defined.
'template literal syntax' is only available in ES6 (use 'esversion: 6').
let device = await client.device(); | ||
this.verifyContactable(device); | ||
|
||
let messages = []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'let' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
return messages; | ||
try { | ||
await this.verifyOnline(client); | ||
let device = await client.device(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'let' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
Missing semicolon.
this.logStatus(device); | ||
return messages; | ||
try { | ||
await this.verifyOnline(client); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected an assignment or function call and instead saw an expression.
Missing semicolon.
return 'Sorry, the thermostat is offline at the moment.'; | ||
} | ||
} finally { | ||
await client.logout(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected an assignment or function call and instead saw an expression.
Missing semicolon.
try { | ||
if (await client.online()) { | ||
return 'Thermostat is online'; | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected an assignment or function call and instead saw an expression.
Expected an identifier and instead saw 'else'.
Missing semicolon.
console.log('*******************************'); | ||
|
||
let userId = request.userId || request.data.session.user.userId; | ||
let source = 'user'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'let' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
} | ||
console.log('*******************************'); | ||
|
||
let userId = request.userId || request.data.session.user.userId; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'let' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
aws/lambda.js
Outdated
console.log('Context'); | ||
console.log(request.context); | ||
if (request.data.context) { | ||
console.log(`Deep UserId: ${request.data.context.System.user.userId}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'template literal syntax' is only available in ES6 (use 'esversion: 6').
aws/lambda.js
Outdated
let context = { userId }; | ||
const controlService = (request) => { | ||
console.log('*******************************'); | ||
console.log(`UserId: ${request.userId}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'template literal syntax' is only available in ES6 (use 'esversion: 6').
@@ -11,8 +11,25 @@ module.change_code = 0; | |||
|
|||
let app = new alexa.app('boiler'); | |||
|
|||
const controlService = (userId) => { | |||
let context = { userId }; | |||
const controlService = (request) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'arrow function syntax (=>)' is only available in ES6 (use 'esversion: 6').
'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
No description provided.