Get discovered zeroconf IPv6 addresses (#65462)
This commit is contained in:
parent
2ffb46dc93
commit
9134e5c844
57 changed files with 163 additions and 0 deletions
|
@ -162,6 +162,7 @@ class HomekitControllerFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
|||
return await self.async_step_zeroconf(
|
||||
zeroconf.ZeroconfServiceInfo(
|
||||
host=record["address"],
|
||||
addresses=[record["address"]],
|
||||
port=record["port"],
|
||||
hostname=record["name"],
|
||||
type="_hap._tcp.local.",
|
||||
|
|
|
@ -101,6 +101,7 @@ class ZeroconfServiceInfo(BaseServiceInfo):
|
|||
"""Prepared info from mDNS entries."""
|
||||
|
||||
host: str
|
||||
addresses: list[str]
|
||||
port: int | None
|
||||
hostname: str
|
||||
type: str
|
||||
|
@ -547,6 +548,7 @@ def info_from_service(service: AsyncServiceInfo) -> ZeroconfServiceInfo | None:
|
|||
|
||||
return ZeroconfServiceInfo(
|
||||
host=str(host),
|
||||
addresses=service.parsed_addresses(),
|
||||
port=service.port,
|
||||
hostname=service.server,
|
||||
type=service.type,
|
||||
|
|
|
@ -22,6 +22,7 @@ from tests.common import MockConfigEntry
|
|||
|
||||
DMAP_SERVICE = zeroconf.ZeroconfServiceInfo(
|
||||
host="127.0.0.1",
|
||||
addresses=["127.0.0.1"],
|
||||
hostname="mock_hostname",
|
||||
port=None,
|
||||
type="_touch-able._tcp.local.",
|
||||
|
@ -32,6 +33,7 @@ DMAP_SERVICE = zeroconf.ZeroconfServiceInfo(
|
|||
|
||||
RAOP_SERVICE = zeroconf.ZeroconfServiceInfo(
|
||||
host="127.0.0.1",
|
||||
addresses=["127.0.0.1"],
|
||||
hostname="mock_hostname",
|
||||
port=None,
|
||||
type="_raop._tcp.local.",
|
||||
|
@ -531,6 +533,7 @@ async def test_zeroconf_unsupported_service_aborts(hass):
|
|||
context={"source": config_entries.SOURCE_ZEROCONF},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="127.0.0.1",
|
||||
addresses=["127.0.0.1"],
|
||||
hostname="mock_hostname",
|
||||
name="mock_name",
|
||||
port=None,
|
||||
|
@ -549,6 +552,7 @@ async def test_zeroconf_add_mrp_device(hass, mrp_device, pairing):
|
|||
context={"source": config_entries.SOURCE_ZEROCONF},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="127.0.0.2",
|
||||
addresses=["127.0.0.2"],
|
||||
hostname="mock_hostname",
|
||||
port=None,
|
||||
name="Kitchen",
|
||||
|
@ -563,6 +567,7 @@ async def test_zeroconf_add_mrp_device(hass, mrp_device, pairing):
|
|||
context={"source": config_entries.SOURCE_ZEROCONF},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="127.0.0.1",
|
||||
addresses=["127.0.0.1"],
|
||||
hostname="mock_hostname",
|
||||
port=None,
|
||||
name="Kitchen",
|
||||
|
@ -750,6 +755,7 @@ async def test_zeroconf_abort_if_other_in_progress(hass, mock_scan):
|
|||
context={"source": config_entries.SOURCE_ZEROCONF},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="127.0.0.1",
|
||||
addresses=["127.0.0.1"],
|
||||
hostname="mock_hostname",
|
||||
port=None,
|
||||
type="_airplay._tcp.local.",
|
||||
|
@ -772,6 +778,7 @@ async def test_zeroconf_abort_if_other_in_progress(hass, mock_scan):
|
|||
context={"source": config_entries.SOURCE_ZEROCONF},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="127.0.0.1",
|
||||
addresses=["127.0.0.1"],
|
||||
hostname="mock_hostname",
|
||||
port=None,
|
||||
type="_mediaremotetv._tcp.local.",
|
||||
|
@ -797,6 +804,7 @@ async def test_zeroconf_missing_device_during_protocol_resolve(
|
|||
context={"source": config_entries.SOURCE_ZEROCONF},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="127.0.0.1",
|
||||
addresses=["127.0.0.1"],
|
||||
hostname="mock_hostname",
|
||||
port=None,
|
||||
type="_airplay._tcp.local.",
|
||||
|
@ -818,6 +826,7 @@ async def test_zeroconf_missing_device_during_protocol_resolve(
|
|||
context={"source": config_entries.SOURCE_ZEROCONF},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="127.0.0.1",
|
||||
addresses=["127.0.0.1"],
|
||||
hostname="mock_hostname",
|
||||
port=None,
|
||||
type="_mediaremotetv._tcp.local.",
|
||||
|
@ -853,6 +862,7 @@ async def test_zeroconf_additional_protocol_resolve_failure(
|
|||
context={"source": config_entries.SOURCE_ZEROCONF},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="127.0.0.1",
|
||||
addresses=["127.0.0.1"],
|
||||
hostname="mock_hostname",
|
||||
port=None,
|
||||
type="_airplay._tcp.local.",
|
||||
|
@ -874,6 +884,7 @@ async def test_zeroconf_additional_protocol_resolve_failure(
|
|||
context={"source": config_entries.SOURCE_ZEROCONF},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="127.0.0.1",
|
||||
addresses=["127.0.0.1"],
|
||||
hostname="mock_hostname",
|
||||
port=None,
|
||||
type="_mediaremotetv._tcp.local.",
|
||||
|
@ -911,6 +922,7 @@ async def test_zeroconf_pair_additionally_found_protocols(
|
|||
context={"source": config_entries.SOURCE_ZEROCONF},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="127.0.0.1",
|
||||
addresses=["127.0.0.1"],
|
||||
hostname="mock_hostname",
|
||||
port=None,
|
||||
type="_airplay._tcp.local.",
|
||||
|
@ -953,6 +965,7 @@ async def test_zeroconf_pair_additionally_found_protocols(
|
|||
context={"source": config_entries.SOURCE_ZEROCONF},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="127.0.0.1",
|
||||
addresses=["127.0.0.1"],
|
||||
hostname="mock_hostname",
|
||||
port=None,
|
||||
type="_mediaremotetv._tcp.local.",
|
||||
|
|
|
@ -298,6 +298,7 @@ async def test_reauth_flow_update_configuration(hass):
|
|||
SOURCE_ZEROCONF,
|
||||
zeroconf.ZeroconfServiceInfo(
|
||||
host=DEFAULT_HOST,
|
||||
addresses=[DEFAULT_HOST],
|
||||
port=80,
|
||||
hostname=f"axis-{MAC.lower()}.local.",
|
||||
type="_axis-video._tcp.local.",
|
||||
|
@ -376,6 +377,7 @@ async def test_discovery_flow(hass, source: str, discovery_info: dict):
|
|||
SOURCE_ZEROCONF,
|
||||
zeroconf.ZeroconfServiceInfo(
|
||||
host=DEFAULT_HOST,
|
||||
addresses=[DEFAULT_HOST],
|
||||
hostname="mock_hostname",
|
||||
name=f"AXIS M1065-LW - {MAC}._axis-video._tcp.local.",
|
||||
port=80,
|
||||
|
@ -430,6 +432,7 @@ async def test_discovered_device_already_configured(
|
|||
SOURCE_ZEROCONF,
|
||||
zeroconf.ZeroconfServiceInfo(
|
||||
host="2.3.4.5",
|
||||
addresses=["2.3.4.5"],
|
||||
hostname="mock_hostname",
|
||||
name=f"AXIS M1065-LW - {MAC}._axis-video._tcp.local.",
|
||||
port=8080,
|
||||
|
@ -504,6 +507,7 @@ async def test_discovery_flow_updated_configuration(
|
|||
SOURCE_ZEROCONF,
|
||||
zeroconf.ZeroconfServiceInfo(
|
||||
host="",
|
||||
addresses=[""],
|
||||
hostname="mock_hostname",
|
||||
name="",
|
||||
port=0,
|
||||
|
@ -552,6 +556,7 @@ async def test_discovery_flow_ignore_non_axis_device(
|
|||
SOURCE_ZEROCONF,
|
||||
zeroconf.ZeroconfServiceInfo(
|
||||
host="169.254.3.4",
|
||||
addresses=["169.254.3.4"],
|
||||
hostname="mock_hostname",
|
||||
name=f"AXIS M1065-LW - {MAC}._axis-video._tcp.local.",
|
||||
port=80,
|
||||
|
|
|
@ -385,6 +385,7 @@ async def test_update_address(hass):
|
|||
AXIS_DOMAIN,
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="2.3.4.5",
|
||||
addresses=["2.3.4.5"],
|
||||
hostname="mock_hostname",
|
||||
name="name",
|
||||
port=80,
|
||||
|
|
|
@ -201,6 +201,7 @@ async def test_zeroconf_form(hass: core.HomeAssistant):
|
|||
context={"source": config_entries.SOURCE_ZEROCONF},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="test-host",
|
||||
addresses=["test-host"],
|
||||
hostname="mock_hostname",
|
||||
name="test-bond-id.some-other-tail-info",
|
||||
port=None,
|
||||
|
@ -238,6 +239,7 @@ async def test_zeroconf_form_token_unavailable(hass: core.HomeAssistant):
|
|||
context={"source": config_entries.SOURCE_ZEROCONF},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="test-host",
|
||||
addresses=["test-host"],
|
||||
hostname="mock_hostname",
|
||||
name="test-bond-id.some-other-tail-info",
|
||||
port=None,
|
||||
|
@ -278,6 +280,7 @@ async def test_zeroconf_form_with_token_available(hass: core.HomeAssistant):
|
|||
context={"source": config_entries.SOURCE_ZEROCONF},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="test-host",
|
||||
addresses=["test-host"],
|
||||
hostname="mock_hostname",
|
||||
name="test-bond-id.some-other-tail-info",
|
||||
port=None,
|
||||
|
@ -318,6 +321,7 @@ async def test_zeroconf_form_with_token_available_name_unavailable(
|
|||
context={"source": config_entries.SOURCE_ZEROCONF},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="test-host",
|
||||
addresses=["test-host"],
|
||||
hostname="mock_hostname",
|
||||
name="test-bond-id.some-other-tail-info",
|
||||
port=None,
|
||||
|
@ -361,6 +365,7 @@ async def test_zeroconf_already_configured(hass: core.HomeAssistant):
|
|||
context={"source": config_entries.SOURCE_ZEROCONF},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="updated-host",
|
||||
addresses=["updated-host"],
|
||||
hostname="mock_hostname",
|
||||
name="already-registered-bond-id.some-other-tail-info",
|
||||
port=None,
|
||||
|
@ -405,6 +410,7 @@ async def test_zeroconf_already_configured_refresh_token(hass: core.HomeAssistan
|
|||
context={"source": config_entries.SOURCE_ZEROCONF},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="updated-host",
|
||||
addresses=["updated-host"],
|
||||
hostname="mock_hostname",
|
||||
name="already-registered-bond-id.some-other-tail-info",
|
||||
port=None,
|
||||
|
@ -442,6 +448,7 @@ async def test_zeroconf_already_configured_no_reload_same_host(
|
|||
context={"source": config_entries.SOURCE_ZEROCONF},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="stored-host",
|
||||
addresses=["stored-host"],
|
||||
hostname="mock_hostname",
|
||||
name="already-registered-bond-id.some-other-tail-info",
|
||||
port=None,
|
||||
|
@ -463,6 +470,7 @@ async def test_zeroconf_form_unexpected_error(hass: core.HomeAssistant):
|
|||
source=config_entries.SOURCE_ZEROCONF,
|
||||
initial_input=zeroconf.ZeroconfServiceInfo(
|
||||
host="test-host",
|
||||
addresses=["test-host"],
|
||||
hostname="mock_hostname",
|
||||
name="test-bond-id.some-other-tail-info",
|
||||
port=None,
|
||||
|
|
|
@ -22,6 +22,7 @@ MOCK_SETTINGS = {
|
|||
}
|
||||
DISCOVERY_INFO = zeroconf.ZeroconfServiceInfo(
|
||||
host="1.1.1.1",
|
||||
addresses=["1.1.1.1"],
|
||||
hostname="shc012345.local.",
|
||||
name="Bosch SHC [test-mac]._http._tcp.local.",
|
||||
port=0,
|
||||
|
@ -533,6 +534,7 @@ async def test_zeroconf_not_bosch_shc(hass, mock_zeroconf):
|
|||
DOMAIN,
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="1.1.1.1",
|
||||
addresses=["1.1.1.1"],
|
||||
hostname="mock_hostname",
|
||||
name="notboschshc",
|
||||
port=None,
|
||||
|
|
|
@ -146,6 +146,7 @@ async def test_zeroconf_snmp_error(hass):
|
|||
context={"source": SOURCE_ZEROCONF},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="mock_host",
|
||||
addresses=["mock_host"],
|
||||
hostname="example.local.",
|
||||
name="Brother Printer",
|
||||
port=None,
|
||||
|
@ -166,6 +167,7 @@ async def test_zeroconf_unsupported_model(hass):
|
|||
context={"source": SOURCE_ZEROCONF},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="mock_host",
|
||||
addresses=["mock_host"],
|
||||
hostname="example.local.",
|
||||
name="Brother Printer",
|
||||
port=None,
|
||||
|
@ -194,6 +196,7 @@ async def test_zeroconf_device_exists_abort(hass):
|
|||
context={"source": SOURCE_ZEROCONF},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="mock_host",
|
||||
addresses=["mock_host"],
|
||||
hostname="example.local.",
|
||||
name="Brother Printer",
|
||||
port=None,
|
||||
|
@ -216,6 +219,7 @@ async def test_zeroconf_no_probe_existing_device(hass):
|
|||
context={"source": SOURCE_ZEROCONF},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="mock_host",
|
||||
addresses=["mock_host"],
|
||||
hostname="localhost",
|
||||
name="Brother Printer",
|
||||
port=None,
|
||||
|
@ -242,6 +246,7 @@ async def test_zeroconf_confirm_create_entry(hass):
|
|||
context={"source": SOURCE_ZEROCONF},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="mock_host",
|
||||
addresses=["mock_host"],
|
||||
hostname="example.local.",
|
||||
name="Brother Printer",
|
||||
port=None,
|
||||
|
|
|
@ -124,6 +124,7 @@ async def test_api_password_abort(hass):
|
|||
SOURCE_ZEROCONF,
|
||||
zeroconf.ZeroconfServiceInfo(
|
||||
host=HOST,
|
||||
addresses=[HOST],
|
||||
hostname="mock_hostname",
|
||||
name="mock_name",
|
||||
port=None,
|
||||
|
|
|
@ -4,6 +4,7 @@ from homeassistant.components import zeroconf
|
|||
|
||||
DISCOVERY_INFO = zeroconf.ZeroconfServiceInfo(
|
||||
host="192.168.0.1",
|
||||
addresses=["192.168.0.1"],
|
||||
port=14791,
|
||||
hostname="test.local.",
|
||||
type="_dvl-deviceapi._tcp.local.",
|
||||
|
@ -21,6 +22,7 @@ DISCOVERY_INFO = zeroconf.ZeroconfServiceInfo(
|
|||
|
||||
DISCOVERY_INFO_WRONG_DEVOLO_DEVICE = zeroconf.ZeroconfServiceInfo(
|
||||
host="mock_host",
|
||||
addresses=["mock_host"],
|
||||
hostname="mock_hostname",
|
||||
name="mock_name",
|
||||
port=None,
|
||||
|
@ -30,6 +32,7 @@ DISCOVERY_INFO_WRONG_DEVOLO_DEVICE = zeroconf.ZeroconfServiceInfo(
|
|||
|
||||
DISCOVERY_INFO_WRONG_DEVICE = zeroconf.ZeroconfServiceInfo(
|
||||
host="mock_host",
|
||||
addresses=["mock_host"],
|
||||
hostname="mock_hostname",
|
||||
name="mock_name",
|
||||
port=None,
|
||||
|
|
|
@ -18,6 +18,7 @@ CONNECTED_STATIONS = {
|
|||
|
||||
DISCOVERY_INFO = zeroconf.ZeroconfServiceInfo(
|
||||
host=IP,
|
||||
addresses=[IP],
|
||||
port=14791,
|
||||
hostname="test.local.",
|
||||
type="_dvl-deviceapi._tcp.local.",
|
||||
|
@ -38,6 +39,7 @@ DISCOVERY_INFO = zeroconf.ZeroconfServiceInfo(
|
|||
|
||||
DISCOVERY_INFO_WRONG_DEVICE = zeroconf.ZeroconfServiceInfo(
|
||||
host="mock_host",
|
||||
addresses=["mock_host"],
|
||||
hostname="mock_hostname",
|
||||
name="mock_name",
|
||||
port=None,
|
||||
|
|
|
@ -84,6 +84,7 @@ async def test_form_zeroconf_wrong_oui(hass):
|
|||
context={"source": config_entries.SOURCE_ZEROCONF},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="192.168.1.8",
|
||||
addresses=["192.168.1.8"],
|
||||
hostname="mock_hostname",
|
||||
name="Doorstation - abc123._axis-video._tcp.local.",
|
||||
port=None,
|
||||
|
@ -103,6 +104,7 @@ async def test_form_zeroconf_link_local_ignored(hass):
|
|||
context={"source": config_entries.SOURCE_ZEROCONF},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="169.254.103.61",
|
||||
addresses=["169.254.103.61"],
|
||||
hostname="mock_hostname",
|
||||
name="Doorstation - abc123._axis-video._tcp.local.",
|
||||
port=None,
|
||||
|
@ -129,6 +131,7 @@ async def test_form_zeroconf_correct_oui(hass):
|
|||
context={"source": config_entries.SOURCE_ZEROCONF},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="192.168.1.5",
|
||||
addresses=["192.168.1.5"],
|
||||
hostname="mock_hostname",
|
||||
name="Doorstation - abc123._axis-video._tcp.local.",
|
||||
port=None,
|
||||
|
@ -191,6 +194,7 @@ async def test_form_zeroconf_correct_oui_wrong_device(hass, doorbell_state_side_
|
|||
context={"source": config_entries.SOURCE_ZEROCONF},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="192.168.1.5",
|
||||
addresses=["192.168.1.5"],
|
||||
hostname="mock_hostname",
|
||||
name="Doorstation - abc123._axis-video._tcp.local.",
|
||||
port=None,
|
||||
|
|
|
@ -61,6 +61,7 @@ async def test_full_zeroconf_flow_implementation(
|
|||
context={"source": SOURCE_ZEROCONF},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="127.0.0.1",
|
||||
addresses=["127.0.0.1"],
|
||||
hostname="example.local.",
|
||||
name="mock_name",
|
||||
port=9123,
|
||||
|
@ -126,6 +127,7 @@ async def test_zeroconf_connection_error(
|
|||
context={"source": SOURCE_ZEROCONF},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="127.0.0.1",
|
||||
addresses=["127.0.0.1"],
|
||||
hostname="mock_hostname",
|
||||
name="mock_name",
|
||||
port=9123,
|
||||
|
@ -167,6 +169,7 @@ async def test_zeroconf_device_exists_abort(
|
|||
context={CONF_SOURCE: SOURCE_ZEROCONF},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="127.0.0.1",
|
||||
addresses=["127.0.0.1"],
|
||||
hostname="mock_hostname",
|
||||
name="mock_name",
|
||||
port=9123,
|
||||
|
@ -187,6 +190,7 @@ async def test_zeroconf_device_exists_abort(
|
|||
context={CONF_SOURCE: SOURCE_ZEROCONF},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="127.0.0.2",
|
||||
addresses=["127.0.0.2"],
|
||||
hostname="mock_hostname",
|
||||
name="mock_name",
|
||||
port=9123,
|
||||
|
|
|
@ -212,6 +212,7 @@ async def test_zeroconf(hass: HomeAssistant) -> None:
|
|||
context={"source": config_entries.SOURCE_ZEROCONF},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="1.1.1.1",
|
||||
addresses=["1.1.1.1"],
|
||||
hostname="mock_hostname",
|
||||
name="mock_name",
|
||||
port=None,
|
||||
|
@ -312,6 +313,7 @@ async def test_zeroconf_serial_already_exists(hass: HomeAssistant) -> None:
|
|||
context={"source": config_entries.SOURCE_ZEROCONF},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="1.1.1.1",
|
||||
addresses=["1.1.1.1"],
|
||||
hostname="mock_hostname",
|
||||
name="mock_name",
|
||||
port=None,
|
||||
|
@ -351,6 +353,7 @@ async def test_zeroconf_host_already_exists(hass: HomeAssistant) -> None:
|
|||
context={"source": config_entries.SOURCE_ZEROCONF},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="1.1.1.1",
|
||||
addresses=["1.1.1.1"],
|
||||
hostname="mock_hostname",
|
||||
name="mock_name",
|
||||
port=None,
|
||||
|
|
|
@ -218,6 +218,7 @@ async def test_discovery_initiation(hass, mock_client, mock_zeroconf):
|
|||
|
||||
service_info = zeroconf.ZeroconfServiceInfo(
|
||||
host="192.168.43.183",
|
||||
addresses=["192.168.43.183"],
|
||||
hostname="test8266.local.",
|
||||
name="mock_name",
|
||||
port=6053,
|
||||
|
@ -252,6 +253,7 @@ async def test_discovery_already_configured_hostname(hass, mock_client):
|
|||
|
||||
service_info = zeroconf.ZeroconfServiceInfo(
|
||||
host="192.168.43.183",
|
||||
addresses=["192.168.43.183"],
|
||||
hostname="test8266.local.",
|
||||
name="mock_name",
|
||||
port=6053,
|
||||
|
@ -279,6 +281,7 @@ async def test_discovery_already_configured_ip(hass, mock_client):
|
|||
|
||||
service_info = zeroconf.ZeroconfServiceInfo(
|
||||
host="192.168.43.183",
|
||||
addresses=["192.168.43.183"],
|
||||
hostname="test8266.local.",
|
||||
name="mock_name",
|
||||
port=6053,
|
||||
|
@ -310,6 +313,7 @@ async def test_discovery_already_configured_name(hass, mock_client):
|
|||
|
||||
service_info = zeroconf.ZeroconfServiceInfo(
|
||||
host="192.168.43.184",
|
||||
addresses=["192.168.43.184"],
|
||||
hostname="test8266.local.",
|
||||
name="mock_name",
|
||||
port=6053,
|
||||
|
@ -331,6 +335,7 @@ async def test_discovery_duplicate_data(hass, mock_client):
|
|||
"""Test discovery aborts if same mDNS packet arrives."""
|
||||
service_info = zeroconf.ZeroconfServiceInfo(
|
||||
host="192.168.43.183",
|
||||
addresses=["192.168.43.183"],
|
||||
hostname="test8266.local.",
|
||||
name="mock_name",
|
||||
port=6053,
|
||||
|
@ -364,6 +369,7 @@ async def test_discovery_updates_unique_id(hass, mock_client):
|
|||
|
||||
service_info = zeroconf.ZeroconfServiceInfo(
|
||||
host="192.168.43.183",
|
||||
addresses=["192.168.43.183"],
|
||||
hostname="test8266.local.",
|
||||
name="mock_name",
|
||||
port=6053,
|
||||
|
|
|
@ -101,6 +101,7 @@ async def test_zeroconf_updates_title(hass, config_entry):
|
|||
assert len(hass.config_entries.async_entries(DOMAIN)) == 2
|
||||
discovery_info = zeroconf.ZeroconfServiceInfo(
|
||||
host="192.168.1.1",
|
||||
addresses=["192.168.1.1"],
|
||||
hostname="mock_hostname",
|
||||
name="mock_name",
|
||||
port=23,
|
||||
|
@ -135,6 +136,7 @@ async def test_config_flow_zeroconf_invalid(hass):
|
|||
# test with no discovery properties
|
||||
discovery_info = zeroconf.ZeroconfServiceInfo(
|
||||
host="127.0.0.1",
|
||||
addresses=["127.0.0.1"],
|
||||
hostname="mock_hostname",
|
||||
name="mock_name",
|
||||
port=23,
|
||||
|
@ -149,6 +151,7 @@ async def test_config_flow_zeroconf_invalid(hass):
|
|||
# test with forked-daapd version < 27
|
||||
discovery_info = zeroconf.ZeroconfServiceInfo(
|
||||
host="127.0.0.1",
|
||||
addresses=["127.0.0.1"],
|
||||
hostname="mock_hostname",
|
||||
name="mock_name",
|
||||
port=23,
|
||||
|
@ -163,6 +166,7 @@ async def test_config_flow_zeroconf_invalid(hass):
|
|||
# test with verbose mtd-version from Firefly
|
||||
discovery_info = zeroconf.ZeroconfServiceInfo(
|
||||
host="127.0.0.1",
|
||||
addresses=["127.0.0.1"],
|
||||
hostname="mock_hostname",
|
||||
name="mock_name",
|
||||
port=23,
|
||||
|
@ -177,6 +181,7 @@ async def test_config_flow_zeroconf_invalid(hass):
|
|||
# test with svn mtd-version from Firefly
|
||||
discovery_info = zeroconf.ZeroconfServiceInfo(
|
||||
host="127.0.0.1",
|
||||
addresses=["127.0.0.1"],
|
||||
hostname="mock_hostname",
|
||||
name="mock_name",
|
||||
port=23,
|
||||
|
@ -194,6 +199,7 @@ async def test_config_flow_zeroconf_valid(hass):
|
|||
"""Test that a valid zeroconf entry works."""
|
||||
discovery_info = zeroconf.ZeroconfServiceInfo(
|
||||
host="192.168.1.1",
|
||||
addresses=["192.168.1.1"],
|
||||
hostname="mock_hostname",
|
||||
name="mock_name",
|
||||
port=23,
|
||||
|
|
|
@ -20,6 +20,7 @@ from tests.common import MockConfigEntry
|
|||
|
||||
MOCK_ZEROCONF_DATA = zeroconf.ZeroconfServiceInfo(
|
||||
host="192.168.0.254",
|
||||
addresses=["192.168.0.254"],
|
||||
port=80,
|
||||
hostname="Freebox-Server.local.",
|
||||
type="_fbx-api._tcp.local.",
|
||||
|
|
|
@ -109,6 +109,7 @@ async def test_form_homekit_unique_id_already_setup(hass):
|
|||
context={"source": config_entries.SOURCE_HOMEKIT},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="1.2.3.4",
|
||||
addresses=["1.2.3.4"],
|
||||
hostname="mock_hostname",
|
||||
name="mock_name",
|
||||
port=None,
|
||||
|
@ -136,6 +137,7 @@ async def test_form_homekit_unique_id_already_setup(hass):
|
|||
context={"source": config_entries.SOURCE_HOMEKIT},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="1.2.3.4",
|
||||
addresses=["1.2.3.4"],
|
||||
hostname="mock_hostname",
|
||||
name="mock_name",
|
||||
port=None,
|
||||
|
@ -160,6 +162,7 @@ async def test_form_homekit_ip_address_already_setup(hass):
|
|||
context={"source": config_entries.SOURCE_HOMEKIT},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="1.2.3.4",
|
||||
addresses=["1.2.3.4"],
|
||||
hostname="mock_hostname",
|
||||
name="mock_name",
|
||||
port=None,
|
||||
|
@ -178,6 +181,7 @@ async def test_form_homekit_ip_address(hass):
|
|||
context={"source": config_entries.SOURCE_HOMEKIT},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="1.2.3.4",
|
||||
addresses=["1.2.3.4"],
|
||||
hostname="mock_hostname",
|
||||
name="mock_name",
|
||||
port=None,
|
||||
|
@ -260,6 +264,7 @@ async def test_discovered_by_homekit_and_dhcp(hass):
|
|||
context={"source": config_entries.SOURCE_HOMEKIT},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="1.2.3.4",
|
||||
addresses=["1.2.3.4"],
|
||||
hostname="mock_hostname",
|
||||
name="mock_name",
|
||||
port=None,
|
||||
|
|
|
@ -74,6 +74,7 @@ async def test_step_zeroconf(hass, setup_guardian):
|
|||
"""Test the zeroconf step."""
|
||||
zeroconf_data = zeroconf.ZeroconfServiceInfo(
|
||||
host="192.168.1.100",
|
||||
addresses=["192.168.1.100"],
|
||||
port=7777,
|
||||
hostname="GVC1-ABCD.local.",
|
||||
type="_api._udp.local.",
|
||||
|
@ -103,6 +104,7 @@ async def test_step_zeroconf_already_in_progress(hass):
|
|||
"""Test the zeroconf step aborting because it's already in progress."""
|
||||
zeroconf_data = zeroconf.ZeroconfServiceInfo(
|
||||
host="192.168.1.100",
|
||||
addresses=["192.168.1.100"],
|
||||
port=7777,
|
||||
hostname="GVC1-ABCD.local.",
|
||||
type="_api._udp.local.",
|
||||
|
|
|
@ -222,6 +222,7 @@ async def device_config_changed(hass, accessories):
|
|||
|
||||
discovery_info = zeroconf.ZeroconfServiceInfo(
|
||||
host="127.0.0.1",
|
||||
addresses=["127.0.0.1"],
|
||||
hostname="mock_hostname",
|
||||
name="TestDevice",
|
||||
port=8080,
|
||||
|
|
|
@ -141,6 +141,7 @@ def get_device_discovery_info(
|
|||
record = device.info
|
||||
result = zeroconf.ZeroconfServiceInfo(
|
||||
host=record["address"],
|
||||
addresses=[record["address"]],
|
||||
hostname=record["name"],
|
||||
name=record["name"],
|
||||
port=record["port"],
|
||||
|
|
|
@ -58,6 +58,7 @@ async def test_discovery_flow_works(hass, aioclient_mock):
|
|||
|
||||
service_info = zeroconf.ZeroconfServiceInfo(
|
||||
host="192.168.43.183",
|
||||
addresses=["192.168.43.183"],
|
||||
port=80,
|
||||
hostname="p1meter-ddeeff.local.",
|
||||
type="",
|
||||
|
@ -140,6 +141,7 @@ async def test_discovery_disabled_api(hass, aioclient_mock):
|
|||
|
||||
service_info = zeroconf.ZeroconfServiceInfo(
|
||||
host="192.168.43.183",
|
||||
addresses=["192.168.43.183"],
|
||||
port=80,
|
||||
hostname="p1meter-ddeeff.local.",
|
||||
type="",
|
||||
|
@ -178,6 +180,7 @@ async def test_discovery_missing_data_in_service_info(hass, aioclient_mock):
|
|||
|
||||
service_info = zeroconf.ZeroconfServiceInfo(
|
||||
host="192.168.43.183",
|
||||
addresses=["192.168.43.183"],
|
||||
port=80,
|
||||
hostname="p1meter-ddeeff.local.",
|
||||
type="",
|
||||
|
@ -206,6 +209,7 @@ async def test_discovery_invalid_api(hass, aioclient_mock):
|
|||
|
||||
service_info = zeroconf.ZeroconfServiceInfo(
|
||||
host="192.168.43.183",
|
||||
addresses=["192.168.43.183"],
|
||||
port=80,
|
||||
hostname="p1meter-ddeeff.local.",
|
||||
type="",
|
||||
|
|
|
@ -566,6 +566,7 @@ async def test_bridge_homekit(hass, aioclient_mock):
|
|||
context={"source": config_entries.SOURCE_HOMEKIT},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="0.0.0.0",
|
||||
addresses=["0.0.0.0"],
|
||||
hostname="mock_hostname",
|
||||
name="mock_name",
|
||||
port=None,
|
||||
|
@ -613,6 +614,7 @@ async def test_bridge_homekit_already_configured(hass, aioclient_mock):
|
|||
context={"source": config_entries.SOURCE_HOMEKIT},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="0.0.0.0",
|
||||
addresses=["0.0.0.0"],
|
||||
hostname="mock_hostname",
|
||||
name="mock_name",
|
||||
port=None,
|
||||
|
@ -739,6 +741,7 @@ async def test_bridge_zeroconf(hass, aioclient_mock):
|
|||
context={"source": config_entries.SOURCE_ZEROCONF},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="192.168.1.217",
|
||||
addresses=["192.168.1.217"],
|
||||
port=443,
|
||||
hostname="Philips-hue.local",
|
||||
type="_hue._tcp.local.",
|
||||
|
@ -772,6 +775,7 @@ async def test_bridge_zeroconf_already_exists(hass, aioclient_mock):
|
|||
context={"source": config_entries.SOURCE_ZEROCONF},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="192.168.1.217",
|
||||
addresses=["192.168.1.217"],
|
||||
port=443,
|
||||
hostname="Philips-hue.local",
|
||||
type="_hue._tcp.local.",
|
||||
|
|
|
@ -13,6 +13,7 @@ from tests.common import MockConfigEntry, load_fixture
|
|||
|
||||
HOMEKIT_DISCOVERY_INFO = zeroconf.ZeroconfServiceInfo(
|
||||
host="1.2.3.4",
|
||||
addresses=["1.2.3.4"],
|
||||
hostname="mock_hostname",
|
||||
name="Hunter Douglas Powerview Hub._hap._tcp.local.",
|
||||
port=None,
|
||||
|
@ -22,6 +23,7 @@ HOMEKIT_DISCOVERY_INFO = zeroconf.ZeroconfServiceInfo(
|
|||
|
||||
ZEROCONF_DISCOVERY_INFO = zeroconf.ZeroconfServiceInfo(
|
||||
host="1.2.3.4",
|
||||
addresses=["1.2.3.4"],
|
||||
hostname="mock_hostname",
|
||||
name="Hunter Douglas Powerview Hub._powerview._tcp.local.",
|
||||
port=None,
|
||||
|
|
|
@ -38,6 +38,7 @@ MOCK_ZEROCONF_IPP_SERVICE_INFO = zeroconf.ZeroconfServiceInfo(
|
|||
type=IPP_ZEROCONF_SERVICE_TYPE,
|
||||
name=f"{ZEROCONF_NAME}.{IPP_ZEROCONF_SERVICE_TYPE}",
|
||||
host=ZEROCONF_HOST,
|
||||
addresses=[ZEROCONF_HOST],
|
||||
hostname=ZEROCONF_HOSTNAME,
|
||||
port=ZEROCONF_PORT,
|
||||
properties={"rp": ZEROCONF_RP},
|
||||
|
@ -47,6 +48,7 @@ MOCK_ZEROCONF_IPPS_SERVICE_INFO = zeroconf.ZeroconfServiceInfo(
|
|||
type=IPPS_ZEROCONF_SERVICE_TYPE,
|
||||
name=f"{ZEROCONF_NAME}.{IPPS_ZEROCONF_SERVICE_TYPE}",
|
||||
host=ZEROCONF_HOST,
|
||||
addresses=[ZEROCONF_HOST],
|
||||
hostname=ZEROCONF_HOSTNAME,
|
||||
port=ZEROCONF_PORT,
|
||||
properties={"rp": ZEROCONF_RP},
|
||||
|
|
|
@ -17,6 +17,7 @@ TEST_WS_PORT = {"ws_port": 9090}
|
|||
UUID = "11111111-1111-1111-1111-111111111111"
|
||||
TEST_DISCOVERY = zeroconf.ZeroconfServiceInfo(
|
||||
host="1.1.1.1",
|
||||
addresses=["1.1.1.1"],
|
||||
port=8080,
|
||||
hostname="hostname.local.",
|
||||
type="_xbmc-jsonrpc-h._tcp.local.",
|
||||
|
@ -27,6 +28,7 @@ TEST_DISCOVERY = zeroconf.ZeroconfServiceInfo(
|
|||
|
||||
TEST_DISCOVERY_WO_UUID = zeroconf.ZeroconfServiceInfo(
|
||||
host="1.1.1.1",
|
||||
addresses=["1.1.1.1"],
|
||||
port=8080,
|
||||
hostname="hostname.local.",
|
||||
type="_xbmc-jsonrpc-h._tcp.local.",
|
||||
|
|
|
@ -19,6 +19,7 @@ ZC_NAME = f"LOOKin_{DEVICE_ID}"
|
|||
ZC_TYPE = "_lookin._tcp."
|
||||
ZEROCONF_DATA = ZeroconfServiceInfo(
|
||||
host=IP_ADDRESS,
|
||||
addresses=[IP_ADDRESS],
|
||||
hostname=f"{ZC_NAME.lower()}.local.",
|
||||
port=80,
|
||||
type=ZC_TYPE,
|
||||
|
|
|
@ -427,6 +427,7 @@ async def test_zeroconf_host_already_configured(hass, tmpdir):
|
|||
context={"source": config_entries.SOURCE_ZEROCONF},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="1.1.1.1",
|
||||
addresses=["1.1.1.1"],
|
||||
hostname="LuTrOn-abc.local.",
|
||||
name="mock_name",
|
||||
port=None,
|
||||
|
@ -454,6 +455,7 @@ async def test_zeroconf_lutron_id_already_configured(hass):
|
|||
context={"source": config_entries.SOURCE_ZEROCONF},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="1.1.1.1",
|
||||
addresses=["1.1.1.1"],
|
||||
hostname="LuTrOn-abc.local.",
|
||||
name="mock_name",
|
||||
port=None,
|
||||
|
@ -476,6 +478,7 @@ async def test_zeroconf_not_lutron_device(hass):
|
|||
context={"source": config_entries.SOURCE_ZEROCONF},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="1.1.1.1",
|
||||
addresses=["1.1.1.1"],
|
||||
hostname="notlutron-abc.local.",
|
||||
name="mock_name",
|
||||
port=None,
|
||||
|
@ -504,6 +507,7 @@ async def test_zeroconf(hass, source, tmpdir):
|
|||
context={"source": source},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="1.1.1.1",
|
||||
addresses=["1.1.1.1"],
|
||||
hostname="LuTrOn-abc.local.",
|
||||
name="mock_name",
|
||||
port=None,
|
||||
|
|
|
@ -71,6 +71,7 @@ async def test_full_zeroconf_flow_implementation(
|
|||
context={"source": SOURCE_ZEROCONF},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="192.168.1.123",
|
||||
addresses=["192.168.1.123"],
|
||||
hostname="example.local.",
|
||||
name="mock_name",
|
||||
port=None,
|
||||
|
@ -140,6 +141,7 @@ async def test_zeroconf_connection_error(
|
|||
context={"source": SOURCE_ZEROCONF},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="192.168.1.123",
|
||||
addresses=["192.168.1.123"],
|
||||
hostname="example.local.",
|
||||
name="mock_name",
|
||||
port=None,
|
||||
|
@ -171,6 +173,7 @@ async def test_zeroconf_confirm_connection_error(
|
|||
},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="192.168.1.123",
|
||||
addresses=["192.168.1.123"],
|
||||
hostname="example.com.",
|
||||
name="mock_name",
|
||||
port=None,
|
||||
|
@ -240,6 +243,7 @@ async def test_zeroconf_with_mac_device_exists_abort(
|
|||
context={"source": SOURCE_ZEROCONF},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="192.168.1.123",
|
||||
addresses=["192.168.1.123"],
|
||||
hostname="example.local.",
|
||||
name="mock_name",
|
||||
port=None,
|
||||
|
|
|
@ -14,6 +14,7 @@ from tests.common import MockConfigEntry
|
|||
|
||||
DISCOVERY_INFO = zeroconf.ZeroconfServiceInfo(
|
||||
host="10.10.2.3",
|
||||
addresses=["10.10.2.3"],
|
||||
hostname="mock_hostname",
|
||||
name="mock_name",
|
||||
port=None,
|
||||
|
|
|
@ -238,6 +238,7 @@ async def test_discovery_link_unavailable(
|
|||
context={"source": source},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host=TEST_HOST,
|
||||
addresses=[TEST_HOST],
|
||||
hostname="mock_hostname",
|
||||
name=f"{TEST_NAME}.{type_in_discovery_info}",
|
||||
port=None,
|
||||
|
@ -422,6 +423,7 @@ async def test_import_discovery_integration(
|
|||
context={"source": source},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host=TEST_HOST,
|
||||
addresses=[TEST_HOST],
|
||||
hostname="mock_hostname",
|
||||
name=f"{TEST_NAME}.{type_in_discovery}",
|
||||
port=None,
|
||||
|
|
|
@ -42,6 +42,7 @@ async def test_abort_if_existing_entry(hass):
|
|||
context={"source": config_entries.SOURCE_HOMEKIT},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="0.0.0.0",
|
||||
addresses=["0.0.0.0"],
|
||||
hostname="mock_hostname",
|
||||
name="mock_name",
|
||||
port=None,
|
||||
|
|
|
@ -37,6 +37,7 @@ async def test_form_zeroconf(hass):
|
|||
context={"source": config_entries.SOURCE_ZEROCONF},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="192.168.1.5",
|
||||
addresses=["192.168.1.5"],
|
||||
hostname="mock_hostname",
|
||||
name="mock_name",
|
||||
port=1234,
|
||||
|
|
|
@ -175,6 +175,7 @@ async def test_show_zerconf_form(hass: HomeAssistant) -> None:
|
|||
context={"source": config_entries.SOURCE_ZEROCONF},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="192.168.1.123",
|
||||
addresses=["192.168.1.123"],
|
||||
hostname="example.local.",
|
||||
name="mock_name",
|
||||
port=80,
|
||||
|
@ -496,6 +497,7 @@ async def test_duplicate_zerconf_ignored(hass: HomeAssistant) -> None:
|
|||
context={"source": config_entries.SOURCE_ZEROCONF},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="192.168.1.123",
|
||||
addresses=["192.168.1.123"],
|
||||
hostname="example.local.",
|
||||
name="mock_name",
|
||||
port=80,
|
||||
|
|
|
@ -33,6 +33,7 @@ MOCK_GATEWAY2_RESPONSE = [Mock(id=TEST_GATEWAY_ID2)]
|
|||
|
||||
FAKE_ZERO_CONF_INFO = ZeroconfServiceInfo(
|
||||
host="192.168.0.51",
|
||||
addresses=["192.168.0.51"],
|
||||
port=443,
|
||||
hostname=f"gateway-{TEST_GATEWAY_ID}.local.",
|
||||
type="_kizbox._tcp.local.",
|
||||
|
|
|
@ -38,6 +38,7 @@ TEST_USERNAME2 = "stretch"
|
|||
|
||||
TEST_DISCOVERY = ZeroconfServiceInfo(
|
||||
host=TEST_HOST,
|
||||
addresses=[TEST_HOST],
|
||||
hostname=f"{TEST_HOSTNAME}.local.",
|
||||
name="mock_name",
|
||||
port=DEFAULT_PORT,
|
||||
|
@ -51,6 +52,7 @@ TEST_DISCOVERY = ZeroconfServiceInfo(
|
|||
|
||||
TEST_DISCOVERY2 = ZeroconfServiceInfo(
|
||||
host=TEST_HOST,
|
||||
addresses=[TEST_HOST],
|
||||
hostname=f"{TEST_HOSTNAME2}.local.",
|
||||
name="mock_name",
|
||||
port=DEFAULT_PORT,
|
||||
|
|
|
@ -114,6 +114,7 @@ async def test_form_homekit(hass):
|
|||
context={"source": config_entries.SOURCE_HOMEKIT},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="mock_host",
|
||||
addresses=["mock_host"],
|
||||
hostname="mock_hostname",
|
||||
name="mock_name",
|
||||
port=None,
|
||||
|
@ -138,6 +139,7 @@ async def test_form_homekit(hass):
|
|||
context={"source": config_entries.SOURCE_HOMEKIT},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="mock_host",
|
||||
addresses=["mock_host"],
|
||||
hostname="mock_hostname",
|
||||
name="mock_name",
|
||||
port=None,
|
||||
|
|
|
@ -149,6 +149,7 @@ async def test_step_homekit_zeroconf_ip_already_exists(
|
|||
context={"source": source},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="192.168.1.100",
|
||||
addresses=["192.168.1.100"],
|
||||
hostname="mock_hostname",
|
||||
name="mock_name",
|
||||
port=None,
|
||||
|
@ -174,6 +175,7 @@ async def test_step_homekit_zeroconf_ip_change(hass, client, config_entry, sourc
|
|||
context={"source": source},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="192.168.1.2",
|
||||
addresses=["192.168.1.2"],
|
||||
hostname="mock_hostname",
|
||||
name="mock_name",
|
||||
port=None,
|
||||
|
@ -202,6 +204,7 @@ async def test_step_homekit_zeroconf_new_controller_when_some_exist(
|
|||
context={"source": source},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="192.168.1.100",
|
||||
addresses=["192.168.1.100"],
|
||||
hostname="mock_hostname",
|
||||
name="mock_name",
|
||||
port=None,
|
||||
|
@ -249,6 +252,7 @@ async def test_discovery_by_homekit_and_zeroconf_same_time(hass, client):
|
|||
context={"source": config_entries.SOURCE_ZEROCONF},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="192.168.1.100",
|
||||
addresses=["192.168.1.100"],
|
||||
hostname="mock_hostname",
|
||||
name="mock_name",
|
||||
port=None,
|
||||
|
@ -268,6 +272,7 @@ async def test_discovery_by_homekit_and_zeroconf_same_time(hass, client):
|
|||
context={"source": config_entries.SOURCE_HOMEKIT},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="192.168.1.100",
|
||||
addresses=["192.168.1.100"],
|
||||
hostname="mock_hostname",
|
||||
name="mock_name",
|
||||
port=None,
|
||||
|
|
|
@ -24,6 +24,7 @@ HOMEKIT_HOST = "192.168.1.161"
|
|||
|
||||
MOCK_HOMEKIT_DISCOVERY_INFO = zeroconf.ZeroconfServiceInfo(
|
||||
host=HOMEKIT_HOST,
|
||||
addresses=[HOMEKIT_HOST],
|
||||
hostname="mock_hostname",
|
||||
name="onn._hap._tcp.local.",
|
||||
port=None,
|
||||
|
|
|
@ -101,6 +101,7 @@ MOCK_DHCP_DATA = dhcp.DhcpServiceInfo(
|
|||
EXISTING_IP = "192.168.40.221"
|
||||
MOCK_ZEROCONF_DATA = zeroconf.ZeroconfServiceInfo(
|
||||
host="fake_host",
|
||||
addresses=["fake_host"],
|
||||
hostname="mock_hostname",
|
||||
name="mock_name",
|
||||
port=1234,
|
||||
|
|
|
@ -19,6 +19,7 @@ MOCK_SETTINGS = {
|
|||
}
|
||||
DISCOVERY_INFO = zeroconf.ZeroconfServiceInfo(
|
||||
host="1.1.1.1",
|
||||
addresses=["1.1.1.1"],
|
||||
hostname="mock_hostname",
|
||||
name="shelly1pm-12345",
|
||||
port=None,
|
||||
|
|
|
@ -57,6 +57,7 @@ async def test_show_zeroconf_connection_error_form(hass):
|
|||
context={"source": SOURCE_ZEROCONF},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="1.2.3.4",
|
||||
addresses=["1.2.3.4"],
|
||||
port=22,
|
||||
hostname="Smappee1006000212.local.",
|
||||
type="_ssh._tcp.local.",
|
||||
|
@ -86,6 +87,7 @@ async def test_show_zeroconf_connection_error_form_next_generation(hass):
|
|||
context={"source": SOURCE_ZEROCONF},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="1.2.3.4",
|
||||
addresses=["1.2.3.4"],
|
||||
port=22,
|
||||
hostname="Smappee5001000212.local.",
|
||||
type="_ssh._tcp.local.",
|
||||
|
@ -168,6 +170,7 @@ async def test_zeroconf_wrong_mdns(hass):
|
|||
context={"source": SOURCE_ZEROCONF},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="1.2.3.4",
|
||||
addresses=["1.2.3.4"],
|
||||
port=22,
|
||||
hostname="example.local.",
|
||||
type="_ssh._tcp.local.",
|
||||
|
@ -278,6 +281,7 @@ async def test_zeroconf_device_exists_abort(hass):
|
|||
context={"source": SOURCE_ZEROCONF},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="1.2.3.4",
|
||||
addresses=["1.2.3.4"],
|
||||
port=22,
|
||||
hostname="Smappee1006000212.local.",
|
||||
type="_ssh._tcp.local.",
|
||||
|
@ -327,6 +331,7 @@ async def test_zeroconf_abort_if_cloud_device_exists(hass):
|
|||
context={"source": SOURCE_ZEROCONF},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="1.2.3.4",
|
||||
addresses=["1.2.3.4"],
|
||||
port=22,
|
||||
hostname="Smappee1006000212.local.",
|
||||
type="_ssh._tcp.local.",
|
||||
|
@ -346,6 +351,7 @@ async def test_zeroconf_confirm_abort_if_cloud_device_exists(hass):
|
|||
context={"source": SOURCE_ZEROCONF},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="1.2.3.4",
|
||||
addresses=["1.2.3.4"],
|
||||
port=22,
|
||||
hostname="Smappee1006000212.local.",
|
||||
type="_ssh._tcp.local.",
|
||||
|
@ -465,6 +471,7 @@ async def test_full_zeroconf_flow(hass):
|
|||
context={"source": SOURCE_ZEROCONF},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="1.2.3.4",
|
||||
addresses=["1.2.3.4"],
|
||||
port=22,
|
||||
hostname="Smappee1006000212.local.",
|
||||
type="_ssh._tcp.local.",
|
||||
|
@ -540,6 +547,7 @@ async def test_full_zeroconf_flow_next_generation(hass):
|
|||
context={"source": SOURCE_ZEROCONF},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="1.2.3.4",
|
||||
addresses=["1.2.3.4"],
|
||||
port=22,
|
||||
hostname="Smappee5001000212.local.",
|
||||
type="_ssh._tcp.local.",
|
||||
|
|
|
@ -50,6 +50,7 @@ def zeroconf_payload():
|
|||
"""Return a default zeroconf payload."""
|
||||
return zeroconf.ZeroconfServiceInfo(
|
||||
host="192.168.4.2",
|
||||
addresses=["192.168.4.2"],
|
||||
hostname="Sonos-aaa",
|
||||
name="Sonos-aaa@Living Room._sonos._tcp.local.",
|
||||
port=None,
|
||||
|
|
|
@ -158,6 +158,7 @@ async def test_zeroconf_sonos_v1(hass: core.HomeAssistant):
|
|||
context={"source": config_entries.SOURCE_ZEROCONF},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="192.168.1.107",
|
||||
addresses=["192.168.1.107"],
|
||||
port=1443,
|
||||
hostname="sonos5CAAFDE47AC8.local.",
|
||||
type="_sonos._tcp.local.",
|
||||
|
|
|
@ -15,6 +15,7 @@ from tests.common import MockConfigEntry
|
|||
|
||||
BLANK_ZEROCONF_INFO = zeroconf.ZeroconfServiceInfo(
|
||||
host="1.2.3.4",
|
||||
addresses=["1.2.3.4"],
|
||||
hostname="mock_hostname",
|
||||
name="mock_name",
|
||||
port=None,
|
||||
|
|
|
@ -30,6 +30,7 @@ FIXTURE_ZEROCONF_INPUT = {
|
|||
|
||||
FIXTURE_ZEROCONF = zeroconf.ZeroconfServiceInfo(
|
||||
host="1.1.1.1",
|
||||
addresses=["1.1.1.1"],
|
||||
port=9170,
|
||||
hostname="test-bridge.local.",
|
||||
type="_system-bridge._udp.local.",
|
||||
|
@ -47,6 +48,7 @@ FIXTURE_ZEROCONF = zeroconf.ZeroconfServiceInfo(
|
|||
|
||||
FIXTURE_ZEROCONF_BAD = zeroconf.ZeroconfServiceInfo(
|
||||
host="1.1.1.1",
|
||||
addresses=["1.1.1.1"],
|
||||
port=9170,
|
||||
hostname="test-bridge.local.",
|
||||
type="_system-bridge._udp.local.",
|
||||
|
|
|
@ -129,6 +129,7 @@ async def test_form_homekit(hass):
|
|||
context={"source": config_entries.SOURCE_HOMEKIT},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="mock_host",
|
||||
addresses=["mock_host"],
|
||||
hostname="mock_hostname",
|
||||
name="mock_name",
|
||||
port=None,
|
||||
|
@ -155,6 +156,7 @@ async def test_form_homekit(hass):
|
|||
context={"source": config_entries.SOURCE_HOMEKIT},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="mock_host",
|
||||
addresses=["mock_host"],
|
||||
hostname="mock_hostname",
|
||||
name="mock_name",
|
||||
port=None,
|
||||
|
|
|
@ -106,6 +106,7 @@ async def test_discovery_connection(hass, mock_auth, mock_entry_setup):
|
|||
context={"source": config_entries.SOURCE_HOMEKIT},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="123.123.123.123",
|
||||
addresses=["123.123.123.123"],
|
||||
hostname="mock_hostname",
|
||||
name="mock_name",
|
||||
port=None,
|
||||
|
@ -261,6 +262,7 @@ async def test_discovery_duplicate_aborted(hass):
|
|||
context={"source": config_entries.SOURCE_HOMEKIT},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="new-host",
|
||||
addresses=["new-host"],
|
||||
hostname="mock_hostname",
|
||||
name="mock_name",
|
||||
port=None,
|
||||
|
@ -296,6 +298,7 @@ async def test_duplicate_discovery(hass, mock_auth, mock_entry_setup):
|
|||
context={"source": config_entries.SOURCE_HOMEKIT},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="123.123.123.123",
|
||||
addresses=["123.123.123.123"],
|
||||
hostname="mock_hostname",
|
||||
name="mock_name",
|
||||
port=None,
|
||||
|
@ -311,6 +314,7 @@ async def test_duplicate_discovery(hass, mock_auth, mock_entry_setup):
|
|||
context={"source": config_entries.SOURCE_HOMEKIT},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="123.123.123.123",
|
||||
addresses=["123.123.123.123"],
|
||||
hostname="mock_hostname",
|
||||
name="mock_name",
|
||||
port=None,
|
||||
|
@ -335,6 +339,7 @@ async def test_discovery_updates_unique_id(hass):
|
|||
context={"source": config_entries.SOURCE_HOMEKIT},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="some-host",
|
||||
addresses=["some-host"],
|
||||
hostname="mock_hostname",
|
||||
name="mock_name",
|
||||
port=None,
|
||||
|
|
|
@ -199,6 +199,7 @@ ZEROCONF_PORT = HOST.split(":")[1]
|
|||
|
||||
MOCK_ZEROCONF_SERVICE_INFO = zeroconf.ZeroconfServiceInfo(
|
||||
host=ZEROCONF_HOST,
|
||||
addresses=[ZEROCONF_HOST],
|
||||
hostname="mock_hostname",
|
||||
name=ZEROCONF_NAME,
|
||||
port=ZEROCONF_PORT,
|
||||
|
|
|
@ -19,6 +19,7 @@ TEST_CONNECTION = {
|
|||
|
||||
TEST_DISCOVERY = zeroconf.ZeroconfServiceInfo(
|
||||
host="1.1.1.1",
|
||||
addresses=["1.1.1.1"],
|
||||
hostname="mock_hostname",
|
||||
name="mock_name",
|
||||
port=3000,
|
||||
|
|
|
@ -51,6 +51,7 @@ async def test_full_zeroconf_flow_implementation(
|
|||
context={"source": SOURCE_ZEROCONF},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="192.168.1.123",
|
||||
addresses=["192.168.1.123"],
|
||||
hostname="example.local.",
|
||||
name="mock_name",
|
||||
port=None,
|
||||
|
@ -110,6 +111,7 @@ async def test_zeroconf_connection_error(
|
|||
context={"source": SOURCE_ZEROCONF},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="192.168.1.123",
|
||||
addresses=["192.168.1.123"],
|
||||
hostname="example.local.",
|
||||
name="mock_name",
|
||||
port=None,
|
||||
|
@ -168,6 +170,7 @@ async def test_zeroconf_without_mac_device_exists_abort(
|
|||
context={"source": SOURCE_ZEROCONF},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="192.168.1.123",
|
||||
addresses=["192.168.1.123"],
|
||||
hostname="example.local.",
|
||||
name="mock_name",
|
||||
port=None,
|
||||
|
@ -192,6 +195,7 @@ async def test_zeroconf_with_mac_device_exists_abort(
|
|||
context={"source": SOURCE_ZEROCONF},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="192.168.1.123",
|
||||
addresses=["192.168.1.123"],
|
||||
hostname="example.local.",
|
||||
name="mock_name",
|
||||
port=None,
|
||||
|
@ -216,6 +220,7 @@ async def test_zeroconf_with_cct_channel_abort(
|
|||
context={"source": SOURCE_ZEROCONF},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host="192.168.1.123",
|
||||
addresses=["192.168.1.123"],
|
||||
hostname="example.local.",
|
||||
name="mock_name",
|
||||
port=None,
|
||||
|
|
|
@ -403,6 +403,7 @@ async def test_zeroconf_success(hass):
|
|||
context={"source": config_entries.SOURCE_ZEROCONF},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host=TEST_HOST,
|
||||
addresses=[TEST_HOST],
|
||||
hostname="mock_hostname",
|
||||
name=TEST_ZEROCONF_NAME,
|
||||
port=None,
|
||||
|
@ -449,6 +450,7 @@ async def test_zeroconf_missing_data(hass):
|
|||
context={"source": config_entries.SOURCE_ZEROCONF},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host=TEST_HOST,
|
||||
addresses=[TEST_HOST],
|
||||
hostname="mock_hostname",
|
||||
name=TEST_ZEROCONF_NAME,
|
||||
port=None,
|
||||
|
@ -468,6 +470,7 @@ async def test_zeroconf_unknown_device(hass):
|
|||
context={"source": config_entries.SOURCE_ZEROCONF},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host=TEST_HOST,
|
||||
addresses=[TEST_HOST],
|
||||
hostname="mock_hostname",
|
||||
name="not-a-xiaomi-aqara-gateway",
|
||||
port=None,
|
||||
|
|
|
@ -394,6 +394,7 @@ async def test_zeroconf_gateway_success(hass):
|
|||
context={"source": config_entries.SOURCE_ZEROCONF},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host=TEST_HOST,
|
||||
addresses=[TEST_HOST],
|
||||
hostname="mock_hostname",
|
||||
name=TEST_ZEROCONF_NAME,
|
||||
port=None,
|
||||
|
@ -436,6 +437,7 @@ async def test_zeroconf_unknown_device(hass):
|
|||
context={"source": config_entries.SOURCE_ZEROCONF},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host=TEST_HOST,
|
||||
addresses=[TEST_HOST],
|
||||
hostname="mock_hostname",
|
||||
name="not-a-xiaomi-miio-device",
|
||||
port=None,
|
||||
|
@ -455,6 +457,7 @@ async def test_zeroconf_no_data(hass):
|
|||
context={"source": config_entries.SOURCE_ZEROCONF},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host=None,
|
||||
addresses=[],
|
||||
hostname="mock_hostname",
|
||||
name=None,
|
||||
port=None,
|
||||
|
@ -474,6 +477,7 @@ async def test_zeroconf_missing_data(hass):
|
|||
context={"source": config_entries.SOURCE_ZEROCONF},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host=TEST_HOST,
|
||||
addresses=[TEST_HOST],
|
||||
hostname="mock_hostname",
|
||||
name=TEST_ZEROCONF_NAME,
|
||||
port=None,
|
||||
|
@ -771,6 +775,7 @@ async def zeroconf_device_success(hass, zeroconf_name_to_test, model_to_test):
|
|||
context={"source": config_entries.SOURCE_ZEROCONF},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host=TEST_HOST,
|
||||
addresses=[TEST_HOST],
|
||||
hostname="mock_hostname",
|
||||
name=zeroconf_name_to_test,
|
||||
port=None,
|
||||
|
|
|
@ -42,6 +42,7 @@ ID_DECIMAL = f"{int(ID, 16):08d}"
|
|||
|
||||
ZEROCONF_DATA = zeroconf.ZeroconfServiceInfo(
|
||||
host=IP_ADDRESS,
|
||||
addresses=[IP_ADDRESS],
|
||||
port=54321,
|
||||
hostname=f"yeelink-light-strip1_miio{ID_DECIMAL}.local.",
|
||||
type="_miio._udp.local.",
|
||||
|
|
|
@ -467,6 +467,7 @@ async def test_discovered_by_homekit_and_dhcp(hass):
|
|||
context={"source": config_entries.SOURCE_HOMEKIT},
|
||||
data=zeroconf.ZeroconfServiceInfo(
|
||||
host=IP_ADDRESS,
|
||||
addresses=[IP_ADDRESS],
|
||||
hostname="mock_hostname",
|
||||
name="mock_name",
|
||||
port=None,
|
||||
|
@ -536,6 +537,7 @@ async def test_discovered_by_homekit_and_dhcp(hass):
|
|||
config_entries.SOURCE_HOMEKIT,
|
||||
zeroconf.ZeroconfServiceInfo(
|
||||
host=IP_ADDRESS,
|
||||
addresses=[IP_ADDRESS],
|
||||
hostname="mock_hostname",
|
||||
name="mock_name",
|
||||
port=None,
|
||||
|
@ -603,6 +605,7 @@ async def test_discovered_by_dhcp_or_homekit(hass, source, data):
|
|||
config_entries.SOURCE_HOMEKIT,
|
||||
zeroconf.ZeroconfServiceInfo(
|
||||
host=IP_ADDRESS,
|
||||
addresses=[IP_ADDRESS],
|
||||
hostname="mock_hostname",
|
||||
name="mock_name",
|
||||
port=None,
|
||||
|
|
|
@ -1095,6 +1095,7 @@ async def test_service_info_compatibility(hass, caplog):
|
|||
"""
|
||||
discovery_info = zeroconf.ZeroconfServiceInfo(
|
||||
host="mock_host",
|
||||
addresses=["mock_host"],
|
||||
port=None,
|
||||
hostname="mock_hostname",
|
||||
type="mock_type",
|
||||
|
|
|
@ -51,6 +51,7 @@ async def test_discovery(detect_mock, hass):
|
|||
"""Test zeroconf flow -- radio detected."""
|
||||
service_info = zeroconf.ZeroconfServiceInfo(
|
||||
host="192.168.1.200",
|
||||
addresses=["192.168.1.200"],
|
||||
hostname="_tube_zb_gw._tcp.local.",
|
||||
name="mock_name",
|
||||
port=6053,
|
||||
|
@ -95,6 +96,7 @@ async def test_discovery_via_zeroconf_ip_change(detect_mock, hass):
|
|||
|
||||
service_info = zeroconf.ZeroconfServiceInfo(
|
||||
host="192.168.1.22",
|
||||
addresses=["192.168.1.22"],
|
||||
hostname="tube_zb_gw_cc2652p2_poe.local.",
|
||||
name="mock_name",
|
||||
port=6053,
|
||||
|
@ -127,6 +129,7 @@ async def test_discovery_via_zeroconf_ip_change_ignored(detect_mock, hass):
|
|||
|
||||
service_info = zeroconf.ZeroconfServiceInfo(
|
||||
host="192.168.1.22",
|
||||
addresses=["192.168.1.22"],
|
||||
hostname="tube_zb_gw_cc2652p2_poe.local.",
|
||||
name="mock_name",
|
||||
port=6053,
|
||||
|
@ -389,6 +392,7 @@ async def test_discovery_already_setup(detect_mock, hass):
|
|||
"""Test zeroconf flow -- radio detected."""
|
||||
service_info = zeroconf.ZeroconfServiceInfo(
|
||||
host="192.168.1.200",
|
||||
addresses=["192.168.1.200"],
|
||||
hostname="_tube_zb_gw._tcp.local.",
|
||||
name="mock_name",
|
||||
port=6053,
|
||||
|
|
Loading…
Add table
Reference in a new issue