-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update library to Python 3.5+ and asyncio #11
Conversation
Would it make sense to use requests.session instead of requests.get and requests.post? That would allow the TCP connection to stay open and thus no need to keep on recreating it. The difference for August from my home was 294ms with request.get compared to 80ms for request.session. Thoughts? |
@ehendrix23 That's definitely the correct principle. Note that this PR does away with |
@bachya Well, that teaches me to just have a look at existing code and the description of this PR. :-) |
Added retries for open and close as I've seen this fail as well. Changed so that update, open, and close return True if successful or False if unsuccessful.
Added retry for open/close and True/False return for update, close, open.
can I help with this? would like to get this back into home assistant as working component. |
@vajonam: Waiting on @arraylabs to approve. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, that appears to have been an undertaking! Will take me a bit to wrap my head around all of it. Thanks for the hard work and I apologize for the delay in getting back to it as I've been traveling again.
No problem, @arraylabs! Are you good if I start on number 2 in my checklist above? |
@bachya yes please do! |
I’ll need you to publish a new version on PyPi. Let me know when that’s in place. 👍🏻 |
@bachya it should be there now, fyi adding the publish/upload to the setup.py just makes things too easy. I should have thought about that about 15 versions ago... |
@arraylabs if you would have done it 15 versions ago then you would not be appreciating how easy that makes it now. :-) @bachya, let me know when you have something for testing. As long as my garage doors won't start opening and closing on random moments I'm good. :-) |
@ehendrix23 FYI, I've submitted a PR to HASS: home-assistant/core#18489 – you can use that for testing. |
OK, just put it in my HASS. Working so far. :-) Noticed though that there are no debug logger messages. I might see to add some in both pymyq and the HASS component once we've got this PR in. |
I am using this as well, works fine this far. no issues to report |
Hi there! Following up on our conversation here, this PR updates the library to be
asyncio
-friendly. It also updates the architecture to be more modular and friendly for future additions.In addition to the library changes, this PR adds a few nice tooling changes that make future contributions easier:
setup.py
Lastly, this bumps the version to
1.0.0
. I chose that number since this is a very breaking update and usually, the first digit gets bumped in that case. Totally open to your wishes, though.My suggestion as to how to proceed:
Thoughts?