arraylabs / pymyq

Python wrapper for MyQ API
MIT License
112 stars 42 forks source link

Error setting up entry email@gmail.com for myq #44

Closed coreyjansen closed 4 years ago

coreyjansen commented 4 years ago

Just started getting this error. I am able to control my garage door but not read the status of the door

Log Details (ERROR) Logger: homeassistant.config_entries Source: components/myq/init.py:36 First occurred: June 25, 2020, 5:59:59 PM (1 occurrences) Last logged: June 25, 2020, 5:59:59 PM

Error setting up entry email@gmail.com for myq Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 217, in async_setup hass, self File "/usr/src/homeassistant/homeassistant/components/myq/init.py", line 36, in async_setup_entry myq = await pymyq.login(conf[CONF_USERNAME], conf[CONF_PASSWORD], websession) File "/usr/local/lib/python3.7/site-packages/pymyq/api.py", line 176, in login await api.authenticate(username, password) File "/usr/local/lib/python3.7/site-packages/pymyq/api.py", line 123, in authenticate login_request=True, File "/usr/local/lib/python3.7/site-packages/pymyq/api.py", line 92, in request data = await resp.json(content_type=None) File "/usr/local/lib/python3.7/site-packages/aiohttp/client_reqrep.py", line 1040, in json return loads(stripped.decode(encoding)) File "/usr/local/lib/python3.7/json/init.py", line 348, in loads return _default_decoder.decode(s) File "/usr/local/lib/python3.7/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/local/lib/python3.7/json/decoder.py", line 353, in raw_decode obj, end = self.scan_once(s, idx) json.decoder.JSONDecodeError: Expecting ',' delimiter: line 4 column 65 (char 114)

dseven commented 4 years ago

Same...

bash-5.0# python3 testmyq.py
Traceback (most recent call last):
  File "testmyq.py", line 20, in <module>
    asyncio.get_event_loop().run_until_complete(main())
  File "/usr/local/lib/python3.7/asyncio/base_events.py", line 587, in run_until_complete
    return future.result()
  File "testmyq.py", line 11, in main
    myq = await pymyq.login('myqdevice@mydomain.com', 'xxxxxxx', websession)
  File "/usr/local/lib/python3.7/site-packages/pymyq/api.py", line 176, in login
    await api.authenticate(username, password)
  File "/usr/local/lib/python3.7/site-packages/pymyq/api.py", line 123, in authenticate
    login_request=True,
  File "/usr/local/lib/python3.7/site-packages/pymyq/api.py", line 92, in request
    data = await resp.json(content_type=None)
  File "/usr/local/lib/python3.7/site-packages/aiohttp/client_reqrep.py", line 1040, in json
    return loads(stripped.decode(encoding))
  File "/usr/local/lib/python3.7/json/__init__.py", line 348, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python3.7/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/lib/python3.7/json/decoder.py", line 353, in raw_decode
    obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Expecting ',' delimiter: line 4 column 64 (char 113)
bash-5.0#
dseven commented 4 years ago

Changing USER_AGENT to "okhttp/3.10.0" (as seen in an Android request) seems to fix it.