Open marcinlubojanski opened 4 years ago
Do you have the right region selected? I seem to remember getting this when I changed region to the wrong one
Yes, it was correct.
I've managed to get list of devices by using the request from HASS-sonoff-ewelink project.
r = requests.get('https://{}-api.coolkit.cc:8080/api/user/device?lang=en&apiKey={}&getTags=1&version=6&ts=%s&nonce=%s&appid=oeVkj2lYFGnJu5XUtWisfW4utiN4u9Mq&imei=%s&os=iOS&model=%s&romVersion=%s&appVersion=%s'.format( self._api_region, self.get_user_apikey(), str(int(time.time())), ''.join(random.choice(string.ascii_lowercase + string.digits) for _ in range(8)), self._imei, self._model, self._romVersion, self._appVersion ), headers=self._headers)
Also modified the do_login to include those variables.
Now I'm fighting with websocket issues... but it might be that my python is missing something (like f.e. logger - I had to remove it from the code) as I'm trying to run it on a WiFi router with entware
@marcinlubojanski did you manage to get this to work? I still get empty lists...
yes, it work for me with the change as written above. Do you also get "params incomplete" error message ?
yes, it work for me with the change as written above. Do you also get "params incomplete" error message ?
I do indeed get the message. I used your PR and it worked, this should be merged - thanks!
I'm logging in properly, then when I try to get list of devices I'm getting error in response
('response :', {u'msg': u'params incomplete', u'error': 400})
Response code: 200
Tried with 2 accounts, one has 2 devices (POW R2 and 4CH), the other has just one shared from the first one (POW R2). If it makes any difference, both were created from Android app, not iPhone.