-
Notifications
You must be signed in to change notification settings - Fork 42
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
Asyncio support? #153
Comments
Hey, |
Cool. I will try and make a mockup of what the HTTP client would look like with asyncio, and keep the sync code as is. First pass will be just to get something that works, but definitely lots of opportunity to share code between the two. If that works, then i'd ditch my prototype from #62 and instead say if you want to multiplex events and request/reply on the same TCP stream like Apple you have to use asyncio. BLE should be possible too with aioble, but will need to extend that to support descriptors from a cursory glance. |
The http aio prototype is nearly ready, got a test that passed but leaves a thread hanging to sort out and events to test out then will port my hass branch to use it and see how it feels. |
I will try to have a look at it soon, latest on the weekend in the train! |
Hanging test fixed, test for auto-reconnect added, going to try and get events working today/tomorrow. |
Got it working in HASS with events, though havent tried pairing yet with a real device yet. Wanted to be able to test events in CI so have added events support to accessory server - see this commit. I can pull this out as a seperate PR for #51 if you like, or we can keep it together. |
It's been on my long term wishlist for a while to have an asyncio client. I thought it was nice but wouldn't enable new features or have much impact in terms of reliability. But working on #61/#62 has been a bit of a pain because of threading, and it would be nice not to have to deal with threads in HASS.
Do you have any interest in having an asyncio client within homekit_python or would it be better served as a seperate project?
The text was updated successfully, but these errors were encountered: