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

Speed up device controls/Wear OS loading by doing network async #2636

Merged

Conversation

jpelgrom
Copy link
Member

Summary

When using the device controls or Wear OS app, multiple messages have to be sent and received on the websocket connection in order to show the entity information. Right now the app waits on a response before sending the next message, which is inefficient because some requests take longer than others (depending on device/server/network/data/...). This PR changes these initial requests to be called async - the app doesn't care in which order the responses arrive, as long as they all arrive before continuing.

I've also included another small change in the device controls where it will now load the initial data first, and only start listening for updates after controls have been provided to the system.

Screenshots

n/a

Link to pull request in Documentation repository

n/a

Any other notes

jpelgrom added 2 commits June 23, 2022 21:54
 - Speed up loading the device controls menu and initial controls by launching all requests in an async block, which allows the server to respond out of order
 - For individual controls, only start listening for changes once we have provided initial controls
 - Speed up a cold boot of the Wear OS app by launching all network requests in an async block, which allows the server to respond out of order
@jpelgrom jpelgrom changed the title Speed up device controls/Wear cold boot by doing network async Speed up device controls/Wear OS loading by doing network async Jun 23, 2022
@JBassett JBassett merged commit 71b1fe1 into home-assistant:master Jun 26, 2022
@jpelgrom jpelgrom deleted the controls-wear-registries-async branch June 26, 2022 18:22
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