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

Send hello and login asynchronously to speed up connecting #628

Merged
merged 15 commits into from
Nov 10, 2023
Merged

Conversation

bdraco
Copy link
Member

@bdraco bdraco commented Nov 9, 2023

Current we send HelloRequest, wait for a response, than send ConnectRequest and wait for a response.

We can send the HelloRequest and ConnectRequest, and than wait for both responses instead as it reduces one round trip wait.

This should speed up connecting with encryption enabled a little bit since it reported to be slow in home-assistant/core#103517 (comment)

INFO Starting log output from largegarage.local using esphome API
INFO Successfully connected to largegarage in 0.061s
INFO Successful handshake with largegarage in 0.022s
[18:45:21][I][app:102]: ESPHome version 2023.11.0b2 compiled on Nov  8 2023, 23:13:11
INFO Starting log output from icemaker.local using esphome API
INFO Successfully connected to icemaker in 0.020s
INFO Successful handshake with icemaker in 0.045s
[18:46:15][I][app:102]: ESPHome version 2023.12.0-dev compiled on Nov  9 2023, 16:50:08

Copy link

codecov bot commented Nov 10, 2023

Codecov Report

Merging #628 (76e2606) into main (8678fa9) will increase coverage by 0.55%.
The diff coverage is 86.36%.

@@            Coverage Diff             @@
##             main     #628      +/-   ##
==========================================
+ Coverage   77.93%   78.49%   +0.55%     
==========================================
  Files          14       14              
  Lines        2493     2511      +18     
==========================================
+ Hits         1943     1971      +28     
+ Misses        550      540      -10     
Files Coverage Δ
aioesphomeapi/connection.py 85.34% <100.00%> (+2.81%) ⬆️
aioesphomeapi/reconnect_logic.py 88.65% <100.00%> (+0.36%) ⬆️
aioesphomeapi/client.py 53.96% <14.28%> (ø)

📣 Codecov offers a browser extension for seamless coverage viewing on GitHub. Try it in Chrome or Firefox today!

@bdraco
Copy link
Member Author

bdraco commented Nov 10, 2023

Looks like we have no coverage for wrong password

@bdraco
Copy link
Member Author

bdraco commented Nov 10, 2023

Manually test with wrong encryption key as well to make sure it doesn't cause a problem

@bdraco bdraco added the minor label Nov 10, 2023
@bdraco bdraco marked this pull request as ready for review November 10, 2023 01:17
@bdraco bdraco merged commit a15b96c into main Nov 10, 2023
10 checks passed
@bdraco bdraco deleted the hello_login branch November 10, 2023 01:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant