Move parts of ssdp to async_upnp_client (#55540)
* Move parts of ssdp to async_upnp_client * Fix test for environments with multiple sources * Fix sonos tests * More fixes/changes * More fixes * Use async_upnp_client==0.21.0 * Pylint/test fixes * More changes after review * Fix tests * Improve testing * Fix mypy * Fix yamaha_musiccast tests? * Changes after review * Pylint * Reduce calls to combined_headers * Update to async_upnp_client==0.21.1 * Update to async_upnp_client==0.21.2 * use as_dict Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
parent
a4a6bf8a85
commit
73260c5b88
30 changed files with 890 additions and 1558 deletions
|
@ -3,25 +3,23 @@ from __future__ import annotations
|
|||
|
||||
import pytest
|
||||
|
||||
from homeassistant.components import ssdp
|
||||
from homeassistant.components.upnp.const import (
|
||||
CONFIG_ENTRY_ST,
|
||||
CONFIG_ENTRY_UDN,
|
||||
DOMAIN,
|
||||
)
|
||||
from homeassistant.core import CoreState, HomeAssistant
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.setup import async_setup_component
|
||||
|
||||
from .common import TEST_DISCOVERY, TEST_ST, TEST_UDN
|
||||
from .mock_ssdp_scanner import mock_ssdp_scanner # noqa: F401
|
||||
from .mock_upnp_device import mock_upnp_device # noqa: F401
|
||||
from .conftest import TEST_ST, TEST_UDN
|
||||
|
||||
from tests.common import MockConfigEntry
|
||||
|
||||
|
||||
@pytest.mark.usefixtures("mock_ssdp_scanner", "mock_upnp_device", "mock_get_source_ip")
|
||||
@pytest.mark.usefixtures("ssdp_instant_discovery", "mock_get_source_ip")
|
||||
async def test_async_setup_entry_default(hass: HomeAssistant):
|
||||
"""Test async_setup_entry."""
|
||||
|
||||
entry = MockConfigEntry(
|
||||
domain=DOMAIN,
|
||||
data={
|
||||
|
@ -34,12 +32,6 @@ async def test_async_setup_entry_default(hass: HomeAssistant):
|
|||
await async_setup_component(hass, DOMAIN, {})
|
||||
await hass.async_block_till_done()
|
||||
|
||||
# Device is discovered.
|
||||
ssdp_scanner: ssdp.Scanner = hass.data[ssdp.DOMAIN]
|
||||
ssdp_scanner.cache[(TEST_UDN, TEST_ST)] = TEST_DISCOVERY
|
||||
# Speed up callback in ssdp.async_register_callback.
|
||||
hass.state = CoreState.not_running
|
||||
|
||||
# Load config_entry.
|
||||
entry.add_to_hass(hass)
|
||||
assert await hass.config_entries.async_setup(entry.entry_id) is True
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue