skydiver / ewelink-api

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

getDevice is ok (device found), but getDevices = { error: 0, devicelist: [] } #146

Open sirpask opened 3 years ago

sirpask commented 3 years ago

in getDevices() i have this code:

const response = await this.makeRequest({ uri: '/user/device', qs: { lang: 'en', appid: APP_ID, ts: timestamp,
version: 8, getTags: 1, }, }); const error = _get(response, 'error', false);

============================================ in getDevice(deviceId)

const device = await this.makeRequest({ uri: /user/device/${deviceId}, qs: { deviceid: deviceId, appid: APP_ID, nonce, ts: timestamp, version: 8, }, });

const error = _get(device, 'error', false);

APP_ID and timestamp is the same in both cases ¿Why i dont found my dispositive? ¿What is the format of response in getDevices for build a file devices-cache.json and turn on and turn of my device?

thanks.