Skip to content
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

Use asyncio facilities for push server where possible #1521

Merged
merged 3 commits into from
Sep 12, 2022

Conversation

starkillerOG
Copy link
Contributor

@starkillerOG starkillerOG commented Sep 6, 2022

Make the push server fully async by avoiding using executors when not necessary.

As required by home-assistant/core#64726

@codecov-commenter
Copy link

codecov-commenter commented Sep 6, 2022

Codecov Report

Merging #1521 (2412cb9) into master (207a053) will decrease coverage by 0.01%.
The diff coverage is 35.48%.

@@            Coverage Diff             @@
##           master    #1521      +/-   ##
==========================================
- Coverage   82.15%   82.13%   -0.02%     
==========================================
  Files         145      145              
  Lines       14161    14164       +3     
  Branches     3416     3416              
==========================================
  Hits        11634    11634              
- Misses       2302     2305       +3     
  Partials      225      225              
Impacted Files Coverage Δ
miio/push_server/serverprotocol.py 25.75% <0.00%> (ø)
miio/push_server/server.py 24.08% <30.00%> (-0.54%) ⬇️
miio/gateway/alarm.py 47.72% <50.00%> (ø)
miio/gateway/devices/subdevice.py 33.14% <50.00%> (ø)
miio/gateway/gateway.py 44.44% <50.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@starkillerOG
Copy link
Contributor Author

@rytilahti I tested this and everything still works.
This makes a clearer seperation between sync and async code by making all push_server functions async.

Can you merge this?

@starkillerOG
Copy link
Contributor Author

@rytilahti could you please merge this so I can move allong with PR home-assistant/core#64726?

Copy link
Owner

@rytilahti rytilahti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM on surface and it is much better this way, so let's get this merged. Thanks! 👍

@rytilahti rytilahti changed the title Push server fully async Use asyncio facilities for push server where possible Sep 12, 2022
@rytilahti rytilahti merged commit ff4e18f into rytilahti:master Sep 12, 2022
@starkillerOG
Copy link
Contributor Author

@rytilahti thanks a lot!
Could you let me know when a new python-miio version is released so I can continue with the HomeAssistant PR?

@rytilahti
Copy link
Owner

I'm currently on holidays so I'm not feeling comfortable creating a new release just right now, especially as the current code base contains lot of changes related to #1495 that should be tested also on other devices that I have in my possession.

I'll try to find some time to review the related homeassistant PR soon though :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants