-
-
Notifications
You must be signed in to change notification settings - Fork 37.3k
Fix MotionMount zeroconf overwriting manually configured static IP #168627
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
base: dev
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -107,9 +107,21 @@ async def async_step_zeroconf( | |||
| # so we can avoid probing the device if its already | ||||
| # configured or ignored | ||||
| await self.async_set_unique_id(unique_id) | ||||
| self._abort_if_unique_id_configured( | ||||
| updates={CONF_HOST: host, CONF_PORT: port} | ||||
| existing_entry = self._async_current_entries() | ||||
| existing_host = next( | ||||
| ( | ||||
| e.data.get(CONF_HOST, "") | ||||
| for e in existing_entry | ||||
| if e.unique_id == unique_id | ||||
| ), | ||||
| "", | ||||
| ) | ||||
| if not existing_host or existing_host.endswith(".local"): | ||||
| host_updates = {CONF_HOST: host, CONF_PORT: port} | ||||
| else: | ||||
| host_updates = {CONF_PORT: port} | ||||
| self.connection_data[CONF_HOST] = existing_host | ||||
|
||||
| self.connection_data[CONF_HOST] = existing_host |
Copilot
AI
Apr 20, 2026
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.
Apply the same mDNS-suffix normalization here as well (e.g., handle .local. with a trailing dot and case-insensitivity) so existing mDNS hosts aren’t misclassified as “static” and skipped for updates unintentionally.
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.
Normalize the hostname before checking for an mDNS
.localsuffix (zeroconf hostnames in this integration include a trailing dot, e.g.MMF8A55F.local., soendswith(".local")will not match and may incorrectly treat an mDNS host as “static”).