8000 Fix Daikin config flow for zeroconf devices by fredrike · Pull Request #36571 · home-assistant/core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix Daikin config flow for zeroconf devices #36571

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

Merged
merged 2 commits into from
Jun 10, 2020

Conversation

fredrike
Copy link
Contributor
@fredrike fredrike commented Jun 8, 2020

Proposed change

MAC-address is not used when discovered via zeroconf. This ensures that the unique_id is not overwritten.

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)
  • 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
  • The code has been formatted using Black (black --fast 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.
  • Untested files have been added to .coveragerc.

The integration reached or maintains the following Integration Quality Scale:

  • No score or internal
  • 🥈 Silver
  • 🥇 Gold
  • 🏆 Platinum

@fredrike
Copy link
Contributor Author
fredrike commented Jun 8, 2020

@TopdRob, can you test if this fixes your issue with entities showing up multiple times.

# Check if mac already is registered
await self.async_set_unique_id(mac)
if not self.unique_id:
await self.async_set_unique_id(mac)
Copy link
Member

Choose a reason for hiding this comment

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

We're not supposed to use different kinds of unique_id for different config flow sources. If we do that it won't work as expected. A zeroconf discovered flow should not be able to compete with a manual flow for the same device.

Copy link
Contributor Author
@fredrike fredrike Jun 10, 2020

Choose a reason for hiding this comment

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

Yes I agree, but mac is not available in async_step_zeroconf (https://github.com/home-assistant/core/pull/36571/files/32d265d8d5e5c90b0206558c379762d522fba912#diff-9ba0b5cb03cb9763543902445049c666R131). This ensures that the dialog doesn't show up for devices discovered (and added) by zeroconf added devices.

To be honest, I think that the zeroconf support should be dropped if this quite ugly fix doesn't go into 0.111 (to not introduce new issues). I don't have any Daikin devices with zeroconf support so it's been a walk in the dark with this implemenatation.

Edit: this is the discussion we had with initial Zeroconf support: #35769 (comment)

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, I think we can add this as a temporary fix. Then for the the next release remove zeroconf support if there's no solution.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

remove zeroconf support if there's no solution

I think that is what we have to do..

@MartinHjelmare MartinHjelmare added this to the 0.111.1 milestone Jun 10, 2020
@MartinHjelmare
Copy link
Member
MartinHjelmare commented Jun 10, 2020

Can we merge this or should we wait for the user test?

@fredrike
Copy link
Contributor Author
fredrike commented Jun 10, 2020

Can we merge this?

Ok by me.

@MartinHjelmare MartinHjelmare merged commit fa17e6d into home-assistant:dev Jun 10, 2020
@balloob balloob mentioned this pull request Jun 11, 2020
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.

4 participants
0