-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
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
Fix Daikin config flow for zeroconf devices #36571
Conversation
@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) |
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.
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.
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.
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)
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 we can add this as a temporary fix. Then for the the next release remove zeroconf support if there's no solution.
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.
remove zeroconf support if there's no solution
I think that is what we have to do..
Can we merge this or should we wait for the user test? |
Ok by me. |
Proposed change
MAC-address is not used when discovered via zeroconf. This ensures that the
unique_id
is not overwritten.Type of change
Additional information
Checklist
black --fast 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
..coveragerc
.The integration reached or maintains the following Integration Quality Scale: