-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
Fix DiscoveryFlowHandler when discovery_function returns bool #133563
Conversation
self._discovery_function is of type Callable[[HomeAssistant], Awaitable[bool] | bool]. Therefore it may or may not be a coroutine. The second case is not handled since commit 17b202d 2024-03-11 Await discovery_function in the DiscoveryFlowHandler instead of wrapping it in a task (home-assistant#113115) Signed-off-by: Konrad Vité <[email protected]>
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.
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
@bdraco would you mind to review, since you introduced the bug? |
Thanks @kgraefe Would you please add a test for this case. |
35747b8
to
7519d52
Compare
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.
Thanks, @kgraefe 👍
../Frenck
Proposed change
self._discovery_function
is of typeCallable[[HomeAssistant], Awaitable[bool] | bool]
. Therefore it may or may not be a coroutine. The second case is not handled since commit #113115 which breaks the installation of the iOS component (#124461).Fixes #124461 introduced by #113115
Type of change
Additional information
Checklist
ruff format homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
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
.To help with the load of incoming pull requests: