Repository navigation
vNext: Remove a stale TODO in the DHCP step - #551
Merged
Merged
Conversation
async_update_entry only returns True when the entry data changed. Since #548 copies the entry data deep, a new IP counts as a change, so the open question in the TODO is answered.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change
Removes
# TODO: Check if this only returns True if the IP Changedfromasync_step_dhcp()inconfig_flow.py.The answer is yes.
ConfigEntries.async_update_entry()returns True only when the entry changed. Since #548 the entry data is copied withcopy.deepcopy(), so a new IP shows up as a change, and an unchanged IP returns False. This was the follow-up point from the review of #548.The
dict()incopy.deepcopy(dict(entry_match.data))stays.ConfigEntry.datais aMappingProxyType, whichcopy.deepcopycannot copy (see the comment on #548).Testing
ruff check .andruff format --checkpass.async_update_entryin Home Assistant 2026.10. The behaviour with and without an IP change was tested with the DHCP harness during the review of vNext: Fix the DHCP step for the sub-units of a gateway #548.