Skip to content

Use asyncio facilities for push server where possible#1521

Merged
rytilahti merged 3 commits intorytilahti:masterfrom
starkillerOG:push_server_async
Sep 12, 2022
Merged

Use asyncio facilities for push server where possible#1521
rytilahti merged 3 commits intorytilahti:masterfrom
starkillerOG:push_server_async

Conversation

@starkillerOG
Copy link
Copy Markdown
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
Copy Markdown

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
Copy Markdown
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
Copy Markdown
Contributor Author

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

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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