Closed roysjosh closed 2 years ago
Obviously you are in 0.x.y semantic versioning so breakage is expected but just wanted to make sure you were aware. If this is intended, I'll open a ticket with pytradfri.
Thanks, that was not intended -- 0.x or not, reasonable use of aiocoap should not break w/o a deprecation over a number.
I'll look into it.
@chrysn if you are working on a release for HA/aiohomekit in #270, it would be good to pick up this one too. I'm not 100% sure if it has been fixed in the meantime though.
I'm presently on it :-)
Yay! Thank you very much
Phew, that's a tough one, for it seems I can't properly subclass a coroutine in Python -- and the preferred pattern for proper shutdown is would be async with Context.create_server_context(site): ...
going forward.
I'm leaning towards just fessing up to this API change ("you can await it for compatibility reason, so your code will keep working unless you directly place the awaitable into a asyncio.create_task()
, but consider using it as an asynchronous context manager right away").
Would it be feasible for you to lockstep this in a pytradfri update? I'm not sure what the intention behind the code is there as it is (I'd just make _get_protocol
await the creation and set the context, it's not like asyncio code is typically multilooped / reentrant), otherwise I'd just propose a change there.
Proposed a fix in https://github.com/home-assistant-libs/pytradfri/pull/536 that AIU should be usable both for the old and the new aiocoap version. If it works out here, it'd reassure me in making this small breaking API change and point to that PR as a reference fix (for those who can't easily go the async context manager route).
Based on discussion in https://github.com/home-assistant-libs/pytradfri/pull/536 I'm fixing this by rolling back the offending commit. Thanks to you and @MartinHjelmare for your input on that matter.
Great stuff, thank you!
The current master branch is about to become 0.4.4, could you give it a test run to verify that your issues were addressed before I push the button?
In fixing #269 the same user tested my PR and found that a different Home Assistant component, pytradfri, broke due to an API change around client/server creation:
Stacktrace copy/pasted here: