mirror of
https://github.com/home-assistant/supervisor.git
synced 2026-08-19 20:58:18 +01:00
* Keep config-declared ports visible after customizing app ports The App.ports getter returned the persisted network mapping wholesale whenever the user had customized any port, instead of merging it with the config-declared ports. As a result, config ports absent from the persisted set silently disappeared. For an app that declares optional, unpublished ports (host port null), publishing one port dropped all others from the info output, so they could no longer be enabled from the UI. Merge the persisted overrides on top of the config-declared ports, keying off the current config so all declared ports stay visible and stale entries removed from the config on update don't leak through. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * Persist cleared port via the ports setter in port-conflict fixup FixupAppClearPortConfig mutated the mapping returned by App.ports in place and relied on that reaching self.persist. Now that the getter reconciles the persisted overrides against the config-declared ports, it returns a freshly constructed dict whenever config ports exist, so the in-place mutation no longer touches persist and the conflicting port was never actually cleared. Assign the modified mapping back through the App.ports setter so the change is written to persist. This also fixes the previously latent case where no port had been customized yet: the getter returned the config data dict, and mutating it never persisted anything either. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * Scope port-conflict fixup to the cleared port FixupAppClearPortConfig cleared the conflicting port by mutating the mapping returned by App.ports and assigning it back. Since App.ports now returns the config-declared defaults merged with the user's overrides, that wrote every current default into persist as if the user had chosen it, freezing those defaults and turning a "clear one port" repair into a much broader change. Add an App.user_ports() accessor that returns only the persisted user overrides, and have the fixup clear the conflicting port on top of those. It persists just the intended override, without folding config defaults into the user config or reaching into the persist storage directly. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>