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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor Hue: phue -> aiohue #13043
Merged
Merged
Refactor Hue: phue -> aiohue #13043
Changes from 10 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
19c8d32
phue -> aiohue
balloob 86274e4
Clean up
balloob 51b58de
Fix config
balloob 0e2a9de
Address comments
balloob dd977c0
Typo
balloob 5ccc678
Fix rebase error
balloob da7a503
Mark light as unavailable when bridge is disconnected
balloob 1f3f0c3
Tests
balloob 0436588
Make Throttle work with double delay and async
balloob 486e032
Rework update logic
balloob d7335bf
Don't resolve host to IP
balloob 15546fe
Clarify comment
balloob 8ea6d4e
No longer do unnecessary updates
balloob ea2e8d1
Add more doc
balloob 99bd4a2
Another comment update
balloob 2d4454f
Wrap up tests
balloob a1a2d5f
Lint
balloob b3e81dc
Fix tests
balloob 9e07108
PyLint does not like mix 'n match async and coroutine
balloob 43cbcf9
Lint
balloob bbd5782
Update aiohue to 1.2
balloob 0a971a1
Lint
balloob 230a8f6
Fix await MagicMock
balloob File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not an
asyncio
expert, but from my recent cast&mqtt async debugging I think this call might be a problem.See,
socket.gethostbyname
can take quite some time to evaluate (5 seconds in my case). Because this is awaited insideasync_setup
it somehow blocks the entire Home Assistant startup.In cast and mqtt the exact same thing is happening to me: Some sync expensive method that is wrapped in an executor task is awaited and blocks the entire startup phase.
I'm not sure as to why this is actually happening. Especially since
media_player
is not inFIRST_INIT_COMPONENTS
I'm struggling to understand why the frontend isn't starting up.For this case it probably wouldn't be that big of a problem. The 5 seconds is not too bad and shouldn't happen too often. Still pointing it out though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, thinking now, I don't think that we ever get a non-IP back from discovery. I think that we can remove this check and just use
host
as the identifier. We will require people to enter an ip address for host in the config.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason the frontend doesn't start up is because it waits for the HOMEASSISTANT_START event but we don't fire that event until all setups are done.
https://github.com/home-assistant/home-assistant/blob/d5612b5ccc4b30ed62022a5b042459ac03425b1e/homeassistant/components/http/__init__.py#L146