skydiver / ewelink-api

eWeLink API for JavaScript
https://www.npmjs.com/package/ewelink-api
MIT License
265 stars 109 forks source link

getDevices() returning empty array #101

Closed matej-cupka closed 3 years ago

matej-cupka commented 3 years ago

I am using ewelink-api@3.0.0 and getDevices() is returning empty array. This is the code I am using:

const connection = new ewelink({
  email,
  password,
  region,
});

const auth = await connection.getCredentials();
console.log(auth);

const devices = await connection.getDevices();
console.log(devices);

And this is what it outputs, it logs in without any problem, but it won't get any device information:

{
  at: 'XXX',
  rt: 'XXX',
  user: {
    clientInfo: {
      model: 'XXX',
      os: 'iOS',
      imei: 'XXX',
      romVersion: '14.0',
      appVersion: '4.2.0'
    },
    _id: 'XXX',
    email: 'XXX',
    password: 'XXX',
    appId: 'XXX',
    createdAt: '2019-07-03T12:56:08.912Z',
    apikey: 'XXX',
    __v: 0,
    lang: 'en',
    online: true,
    onlineTime: '2020-07-23T06:56:09.432Z',
    appInfos: [ [Object], [Object] ],
    ip: 'XXX',
    location: '',
    offlineTime: '2020-07-23T06:39:35.010Z',
    userStatus: '2',
    countryCode: '+421',
    currentFamilyId: 'XXX'
  },
  region: 'eu'
}

[]
ttz642 commented 3 years ago

@MatoC9 Take a look at issue #88

matej-cupka commented 3 years ago

That seems to resolve my issue, thanks