Skip to content

vNext: Remove a stale TODO in the DHCP step - #551

Merged
RobHofmann merged 1 commit into
5.0-devfrom
fix/dhcp-remove-stale-todo
Oct 9, 2026
Merged

RobHofmann merged 1 commit into
5.0-devfrom
fix/dhcp-remove-stale-todo

Conversation

@RobHofmann

Copy link
Copy Markdown
Owner

Change

Removes # TODO: Check if this only returns True if the IP Changed from async_step_dhcp() in config_flow.py.

The answer is yes. ConfigEntries.async_update_entry() returns True only when the entry changed. Since #548 the entry data is copied with copy.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() in copy.deepcopy(dict(entry_match.data)) stays. ConfigEntry.data is a MappingProxyType, which copy.deepcopy cannot copy (see the comment on #548).

Testing

  • Comment-only change, no behaviour change.
  • Ruff 0.17.0: ruff check . and ruff format --check pass.
  • The return value was checked in the docstring of async_update_entry in 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.

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.
@RobHofmann
RobHofmann merged commit c2bc8c4 into 5.0-dev Oct 9, 2026
4 checks passed
@RobHofmann
RobHofmann deleted the fix/dhcp-remove-stale-todo branch October 9, 2026 21:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant