mirror of
https://github.com/skydiver/ewelink-api.git
synced 2025-12-21 21:33:11 +01:00
fixed bug with undefined variable
This commit is contained in:
8
main.js
8
main.js
@@ -3,12 +3,14 @@ const W3CWebSocket = require('websocket').w3cwebsocket;
|
||||
const WebSocketAsPromised = require('websocket-as-promised');
|
||||
const delay = require('delay');
|
||||
|
||||
const { _get } = require('./lib/helpers');
|
||||
|
||||
const {
|
||||
makeAuthorizationSign,
|
||||
loginPayload,
|
||||
wssLoginPayload,
|
||||
wssUpdatePayload,
|
||||
} = require('./lib/helper');
|
||||
} = require('./lib/ewelink-helper');
|
||||
|
||||
class eWeLink {
|
||||
constructor({ region = 'us', email, password }) {
|
||||
@@ -51,8 +53,8 @@ class eWeLink {
|
||||
body,
|
||||
json: true,
|
||||
});
|
||||
this.apiKey = response.user.apikey;
|
||||
this.at = response.at;
|
||||
this.apiKey = _get(response, 'user.apikey', '');
|
||||
this.at = _get(response, 'at', '');
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user