-
-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
Refactor homekit_controller to be fully asynchronous #32111
Refactor homekit_controller to be fully asynchronous #32111
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #32111 +/- ##
==========================================
+ Coverage 94.72% 94.74% +0.01%
==========================================
Files 767 767
Lines 55486 55495 +9
==========================================
+ Hits 52560 52578 +18
+ Misses 2926 2917 -9
Continue to review full report at Codecov.
|
@@ -60,13 +74,21 @@ | |||
] | |||
|
|||
|
|||
def _setup_flow_handler(hass): | |||
def _setup_flow_handler(hass, pairing=None): | |||
flow = config_flow.HomekitControllerFlowHandler() |
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.
In another PR this should preferably be made more robust by using the core interfaces to set up the tests. Ie start the config flow with hass.config_entries.flow.async_init
. See the hue config flow tests for good examples.
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.
Yeah i think i saw your PR doing this to an integration a little while back and put it on my todo list (see PR description). Thanks for the pointer to a good example.
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.
Great!
Breaking change
Unsure whether to add anything here. homekit_controller will switch from using a synchronous and blocking implementation of the homekit protocol to using a fully asynchronous one. This should be seamless and no configuration changes are required. But it is obviously a riskier change than usual so should be highlighted?
Proposed change
homekit_controller currently using a synchronous dependency for speaking the HomeKit protocol and I want to change this:
This is a long running branch for me - the first working prototype has been running since Jul 2019. Much time has been spent testing it since then and getting it ready. And I think we might nearly be there.
Note to reviewers - I plan to do follow up PR's for things which I felt didn't belong in this PR:
hass.config_entries.flow.async_init
etc which I think is best practice now?Type of change
Additional information
Checklist
black --fast homeassistant tests
)If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
.The integration reached or maintains the following Integration Quality Scale: