Set up network integration independently of http (#176137)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Stefan Agner
2026-07-14 16:43:48 +02:00
committed by GitHub
co-authored by Claude Fable 5
parent d1a60af873
commit 67e22ba3b2
3 changed files with 6 additions and 2 deletions
@@ -2,7 +2,6 @@
"domain": "network",
"name": "Network Configuration",
"codeowners": ["@home-assistant/core"],
"dependencies": ["websocket_api"],
"documentation": "https://www.home-assistant.io/integrations/network",
"integration_type": "system",
"iot_class": "local_push",
+1 -1
View File
@@ -608,7 +608,7 @@ async def test_async_get_source_ip_cannot_be_determined_and_no_enabled_addresses
"homeassistant.components.network.util.ifaddr.get_adapters",
return_value=[],
):
assert not await async_setup_component(hass, DOMAIN, {DOMAIN: {}})
assert await async_setup_component(hass, DOMAIN, {DOMAIN: {}})
await hass.async_block_till_done()
with pytest.raises(HomeAssistantError):
await network.async_get_source_ip(hass, MDNS_TARGET_IP)
+5
View File
@@ -763,6 +763,11 @@ async def test_bind_failure_skips_adapter(
if self.source == ("2001:db8::", 0, 0, 1):
raise OSError
# The UPnP server needs a presentation URL, which is derived from the
# instance URL. In production http is set up before ssdp; set an internal
# URL here so get_url() succeeds without relying on http being set up.
hass.config.internal_url = "http://10.10.10.10:8123"
SsdpListener.async_start = _async_start
UpnpServer.async_start = _async_start
await init_ssdp_component(hass)