arraylabs / pymyq

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

Update request.py #183

Open rtorchia opened 10 months ago

rtorchia commented 10 months ago

added to check for status 403 error. This corrects recent errors many have been complaining about in Home Assistant

michaeldavie commented 10 months ago

How does refreshing the user agent correct the 403 error?

adamysu commented 10 months ago

This isn't the right fix. The issue is that a UA is not being sent and myq seems to be blocking such requests. Per https://github.com/home-assistant/core/issues/99947#issuecomment-1712581193, it seems that by changing line 34 in request.py from

self._useragent = None

to

self._useragent = str("anytexthere")

corrects the 403 error.

michaeldavie commented 10 months ago

It looks like this PR should be closed in favour of #182.

deanq commented 9 months ago

This fixed the issue. Without this, the app kept retrying the same expired JWT token. It is now working 100% for me.