From 44ca65b1e186b5dd9016f01f0097b690c361bed6 Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Thu, 22 Jan 2026 18:38:23 +0100 Subject: [PATCH] Revert deprecation of `server_host` for container installations (#161443) Co-authored-by: Robert Resch --- homeassistant/components/http/__init__.py | 12 +++--------- homeassistant/components/http/strings.json | 4 ---- tests/components/http/test_init.py | 22 +++------------------- 3 files changed, 6 insertions(+), 32 deletions(-) diff --git a/homeassistant/components/http/__init__.py b/homeassistant/components/http/__init__.py index 12bc5a4f075..75971b1ed1d 100644 --- a/homeassistant/components/http/__init__.py +++ b/homeassistant/components/http/__init__.py @@ -108,7 +108,6 @@ _DEFAULT_BIND = ["0.0.0.0", "::"] if _HAS_IPV6 else ["0.0.0.0"] HTTP_SCHEMA: Final = vol.All( cv.deprecated(CONF_BASE_URL), - cv.deprecated(CONF_SERVER_HOST), # Deprecated in HA Core 2025.12 vol.Schema( { vol.Optional(CONF_SERVER_HOST): vol.All( @@ -209,20 +208,15 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: if conf is None: conf = cast(ConfData, HTTP_SCHEMA({})) - if CONF_SERVER_HOST in conf: - if is_hassio(hass): - issue_id = "server_host_deprecated_hassio" - severity = ir.IssueSeverity.ERROR - else: - issue_id = "server_host_deprecated" - severity = ir.IssueSeverity.WARNING + if CONF_SERVER_HOST in conf and is_hassio(hass): + issue_id = "server_host_deprecated_hassio" ir.async_create_issue( hass, DOMAIN, issue_id, breaks_in_ha_version="2026.6.0", is_fixable=False, - severity=severity, + severity=ir.IssueSeverity.ERROR, translation_key=issue_id, ) diff --git a/homeassistant/components/http/strings.json b/homeassistant/components/http/strings.json index f9d47466942..b74cfd457b2 100644 --- a/homeassistant/components/http/strings.json +++ b/homeassistant/components/http/strings.json @@ -1,9 +1,5 @@ { "issues": { - "server_host_deprecated": { - "description": "The `server_host` configuration option in the HTTP integration is deprecated and will be removed.\n\nIf you are using this option to bind Home Assistant to specific network interfaces, please remove it from your configuration. Home Assistant will automatically bind to all available interfaces by default.\n\nIf you have specific networking requirements, consider using firewall rules or other network configuration to control access to Home Assistant.", - "title": "The `server_host` HTTP configuration option is deprecated" - }, "server_host_deprecated_hassio": { "description": "The deprecated `server_host` configuration option in the HTTP integration is prone to break the communication between Home Assistant Core and Supervisor, and will be removed.\n\nIf you are using this option to bind Home Assistant to specific network interfaces, please remove it from your configuration. Home Assistant will automatically bind to all available interfaces by default.\n\nIf you have specific networking requirements, consider using firewall rules or other network configuration to control access to Home Assistant.", "title": "The `server_host` HTTP configuration may break Home Assistant Core - Supervisor communication" diff --git a/tests/components/http/test_init.py b/tests/components/http/test_init.py index 9f9af5896db..2f7517f8ecb 100644 --- a/tests/components/http/test_init.py +++ b/tests/components/http/test_init.py @@ -683,26 +683,18 @@ async def test_ssl_issue_urls_configured( "hassio", "http_config", "expected_serverhost", - "expected_warning_count", "expected_issues", ), [ - (False, {}, ["0.0.0.0", "::"], 0, set()), - ( - False, - {"server_host": "0.0.0.0"}, - ["0.0.0.0"], - 1, - {("http", "server_host_deprecated")}, - ), - (True, {}, ["0.0.0.0", "::"], 0, set()), + (False, {}, ["0.0.0.0", "::"], set()), + (False, {"server_host": "0.0.0.0"}, ["0.0.0.0"], set()), + (True, {}, ["0.0.0.0", "::"], set()), ( True, {"server_host": "0.0.0.0"}, [ "0.0.0.0", ], - 1, {("http", "server_host_deprecated_hassio")}, ), ], @@ -713,7 +705,6 @@ async def test_server_host( issue_registry: ir.IssueRegistry, http_config: dict, expected_serverhost: list, - expected_warning_count: int, expected_issues: set[tuple[str, str]], caplog: pytest.LogCaptureFixture, ) -> None: @@ -743,11 +734,4 @@ async def test_server_host( reuse_port=None, ) - assert ( - caplog.text.count( - "The 'server_host' option is deprecated, please remove it from your configuration" - ) - == expected_warning_count - ) - assert set(issue_registry.issues) == expected_issues