HAP-python icon indicating copy to clipboard operation
HAP-python copied to clipboard

Port accessories to asyncio

Open thomaspurchas opened this issue 6 years ago • 5 comments

This should merge into #74. Gonna start working on moving the HTTP bridge.

Unfortunately there are some limits to running the event loop in threads. Notably subprocess don't work in threads, unless the main thread is running an event loop.

I think I might start work migrating the driver over to asyncio, so an event loop is running in the main thread.

With regards to this port, feedback welcome, also testing as I don't have access to all the hardware.

thomaspurchas avatar Apr 01 '18 17:04 thomaspurchas

Hey! I will go over the PR later when I get to a computer. As for the loop in the driver - this is the core of the PR I opened, would you mind if I finish it?

ikalchev avatar Apr 01 '18 17:04 ikalchev

Ahh, I thought the PR you opened was only for the Accessory.run method. Didn't realise you where gonna redo the accessory driver as well!

thomaspurchas avatar Apr 01 '18 18:04 thomaspurchas

Hey! Too busy the last week, but I submitted the asyncio today (in dev). Could you revise this?

ikalchev avatar Apr 13 '18 06:04 ikalchev

Sure thing. Might take me few days tho, I have also had a very busy week.

Best Thomas

On 13 Apr 2018, 07:11 +0100, Ivan Kalchev [email protected], wrote:

Hey! Too busy the last week, but I submitted the asyncio today (in dev). Could you revise this? — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

thomaspurchas avatar Apr 13 '18 07:04 thomaspurchas

Note that one of the merges broke the accessories (the Category is now in costs.py and is not a class). Will try to fix this soon

ikalchev avatar Apr 16 '18 19:04 ikalchev