mirror of
https://github.com/home-assistant/core.git
synced 2025-04-23 08:47:57 +00:00
Switch elkm1 to use integration discovery (#66572)
This commit is contained in:
parent
b28754e5fe
commit
d79d775d92
@ -126,10 +126,10 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
||||
)
|
||||
return await self._async_handle_discovery()
|
||||
|
||||
async def async_step_discovery(
|
||||
async def async_step_integration_discovery(
|
||||
self, discovery_info: DiscoveryInfoType
|
||||
) -> FlowResult:
|
||||
"""Handle discovery."""
|
||||
"""Handle integration discovery."""
|
||||
self._discovered_device = ElkSystem(
|
||||
discovery_info["mac_address"],
|
||||
discovery_info["ip_address"],
|
||||
|
@ -88,7 +88,7 @@ def async_trigger_discovery(
|
||||
hass.async_create_task(
|
||||
hass.config_entries.flow.async_init(
|
||||
DOMAIN,
|
||||
context={"source": config_entries.SOURCE_DISCOVERY},
|
||||
context={"source": config_entries.SOURCE_INTEGRATION_DISCOVERY},
|
||||
data=asdict(device),
|
||||
)
|
||||
)
|
||||
|
@ -656,7 +656,7 @@ async def test_form_import_device_discovered(hass):
|
||||
"source, data",
|
||||
[
|
||||
(config_entries.SOURCE_DHCP, DHCP_DISCOVERY),
|
||||
(config_entries.SOURCE_DISCOVERY, ELK_DISCOVERY_INFO),
|
||||
(config_entries.SOURCE_INTEGRATION_DISCOVERY, ELK_DISCOVERY_INFO),
|
||||
],
|
||||
)
|
||||
async def test_discovered_by_dhcp_or_discovery_mac_address_mismatch_host_already_configured(
|
||||
@ -686,7 +686,7 @@ async def test_discovered_by_dhcp_or_discovery_mac_address_mismatch_host_already
|
||||
"source, data",
|
||||
[
|
||||
(config_entries.SOURCE_DHCP, DHCP_DISCOVERY),
|
||||
(config_entries.SOURCE_DISCOVERY, ELK_DISCOVERY_INFO),
|
||||
(config_entries.SOURCE_INTEGRATION_DISCOVERY, ELK_DISCOVERY_INFO),
|
||||
],
|
||||
)
|
||||
async def test_discovered_by_dhcp_or_discovery_adds_missing_unique_id(
|
||||
@ -717,7 +717,7 @@ async def test_discovered_by_discovery_and_dhcp(hass):
|
||||
with _patch_discovery(), _patch_elk():
|
||||
result = await hass.config_entries.flow.async_init(
|
||||
DOMAIN,
|
||||
context={"source": config_entries.SOURCE_DISCOVERY},
|
||||
context={"source": config_entries.SOURCE_INTEGRATION_DISCOVERY},
|
||||
data=ELK_DISCOVERY_INFO,
|
||||
)
|
||||
await hass.async_block_till_done()
|
||||
@ -755,7 +755,7 @@ async def test_discovered_by_discovery(hass):
|
||||
with _patch_discovery(), _patch_elk():
|
||||
result = await hass.config_entries.flow.async_init(
|
||||
DOMAIN,
|
||||
context={"source": config_entries.SOURCE_DISCOVERY},
|
||||
context={"source": config_entries.SOURCE_INTEGRATION_DISCOVERY},
|
||||
data=ELK_DISCOVERY_INFO,
|
||||
)
|
||||
await hass.async_block_till_done()
|
||||
@ -806,7 +806,7 @@ async def test_discovered_by_discovery_url_already_configured(hass):
|
||||
with _patch_discovery(), _patch_elk():
|
||||
result = await hass.config_entries.flow.async_init(
|
||||
DOMAIN,
|
||||
context={"source": config_entries.SOURCE_DISCOVERY},
|
||||
context={"source": config_entries.SOURCE_INTEGRATION_DISCOVERY},
|
||||
data=ELK_DISCOVERY_INFO,
|
||||
)
|
||||
await hass.async_block_till_done()
|
||||
|
Loading…
x
Reference in New Issue
Block a user