Add async Websocket client#212
Conversation
b3ec024 to
8419b64
Compare
4130964 to
ca5995f
Compare
1f827fb to
4e72bd2
Compare
GrandMoff100
left a comment
There was a problem hiding this comment.
Looks really awesome! Thank you so much!!!
That just leaves the last thing to do which is to add tests for each of the async websocket methods.
|
I'm going to convert this to a draft PR, and then you'll convert it back when its ready to be reviewed and merged for real. |
e7310c9 to
5d767bc
Compare
That should be it. I can't see the coverage, but hopefully I've covered everything. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #212 +/- ##
==========================================
+ Coverage 99.59% 99.66% +0.06%
==========================================
Files 27 29 +2
Lines 1966 2359 +393
==========================================
+ Hits 1958 2351 +393
Misses 8 8 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
I finally figured out why. Codecov recently changed their behavior so that github actions running on forks now require a |
|
@mj23000 I am happy to aid you in developing the tests we need to increase the coverage. There are some parts of the codebase that need some clever ideas to test them appropriately. |
Yes that sounds good! |
9b905d9 to
39cabed
Compare
39cabed to
b4de87a
Compare
Use Domain.from_json_with_client() in websocket clients since Domain requires a client reference. Add config entry methods (get, disable, enable, ignore flow, subentries, subscribe) to RawWebsocketClient.
Add async counterparts for all config entry websocket methods in RawAsyncWebsocketClient. Add async tests for websocket state, entity, config entry, and error path coverage. Fix conftest return type annotation, replace zip(range) with break, and use pytest.raises instead of try/except in error tests.
This async version of the Websocket client is mostly just an async version of the existing client, though with the addition of a
RawBaseWebsocketClientthat is inherited from by both clients.No clever handling of the client type has been implemented as with the REST API client withuse_async. This does have the benefit of not being a breaking change.A similar structure to the existing REST API client has been implemented.
Commits will be cleaned up when the PR is more ready to be merged.