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

Fix DiscoveryFlowHandler when discovery_function returns bool #133563

Merged
merged 5 commits into from
Jan 16, 2025

Conversation

kgraefe
Copy link
Contributor

@kgraefe kgraefe commented Dec 19, 2024

Proposed change

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 #113115 which breaks the installation of the iOS component (#124461).

Fixes #124461 introduced by #113115

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.

To help with the load of incoming pull requests:

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]>
@kgraefe kgraefe requested a review from a team as a code owner December 19, 2024 10:24
@home-assistant home-assistant bot added bugfix cla-needed core small-pr PRs with less than 30 lines. labels Dec 19, 2024
Copy link

@home-assistant home-assistant bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @kgraefe

It seems you haven't yet signed a CLA. Please do so here.

Once you do that we will be able to review and accept this pull request.

Thanks!

@home-assistant
Copy link

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@home-assistant home-assistant bot marked this pull request as draft December 19, 2024 10:24
@kgraefe kgraefe marked this pull request as ready for review December 19, 2024 10:26
@kgraefe
Copy link
Contributor Author

kgraefe commented Jan 15, 2025

@bdraco would you mind to review, since you introduced the bug?

@bdraco
Copy link
Member

bdraco commented Jan 15, 2025

Thanks @kgraefe

Would you please add a test for this case.

@kgraefe kgraefe force-pushed the fix-ios-integration branch from 35747b8 to 7519d52 Compare January 16, 2025 10:20
@bdraco bdraco added this to the 2025.1.3 milestone Jan 16, 2025
Copy link
Member

@frenck frenck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @kgraefe 👍

../Frenck

@bdraco bdraco merged commit e6c6969 into home-assistant:dev Jan 16, 2025
46 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jan 17, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Unknown error occurred" installing Home Assistant iOS
3 participants