Skip to content
This repository has been archived by the owner on Jul 10, 2024. It is now read-only.

Concurrent user issue #8

Merged
merged 9 commits into from
Mar 28, 2019
Merged

Concurrent user issue #8

merged 9 commits into from
Mar 28, 2019

Conversation

matthewturner
Copy link
Owner

No description provided.


async logout() {
console.log('Logging out...');
await request.get(this.urlTo('logout', false), { jar: this._jar});

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() {

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);

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 = {

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);

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;

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;

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);

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) => {

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) {

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)
};
}

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);

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 = '';

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) => {

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');

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'),

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'),

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);

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.`);

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.`);

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').

@@ -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}`);

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 = [];

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();

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);

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();

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 {

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';

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;

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}`);

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}`);

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) => {

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).

Matt Turner and others added 4 commits March 28, 2019 09:15
@matthewturner matthewturner merged commit 32d216a into master Mar 28, 2019
@matthewturner matthewturner deleted the concurrent-user-issue branch March 28, 2019 17:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants