Switch tplink to use integration discovery (#66575)

This commit is contained in:
J. Nick Koston 2022-02-16 05:06:58 -06:00 committed by GitHub
parent 59cb1444a5
commit 38b9bea9a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 6 deletions

View File

@ -39,7 +39,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={
CONF_NAME: device.alias,
CONF_HOST: device.host,

View File

@ -35,10 +35,10 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
discovery_info.ip, discovery_info.macaddress
)
async def async_step_discovery(
async def async_step_integration_discovery(
self, discovery_info: DiscoveryInfoType
) -> FlowResult:
"""Handle discovery."""
"""Handle integration discovery."""
return await self._async_handle_discovery(
discovery_info[CONF_HOST], discovery_info[CONF_MAC]
)

View File

@ -252,7 +252,7 @@ async def test_discovered_by_discovery_and_dhcp(hass):
with _patch_discovery(), _patch_single_discovery():
result = await hass.config_entries.flow.async_init(
DOMAIN,
context={"source": config_entries.SOURCE_DISCOVERY},
context={"source": config_entries.SOURCE_INTEGRATION_DISCOVERY},
data={CONF_HOST: IP_ADDRESS, CONF_MAC: MAC_ADDRESS, CONF_NAME: ALIAS},
)
await hass.async_block_till_done()
@ -304,7 +304,7 @@ async def test_discovered_by_discovery_and_dhcp(hass):
dhcp.DhcpServiceInfo(ip=IP_ADDRESS, macaddress=MAC_ADDRESS, hostname=ALIAS),
),
(
config_entries.SOURCE_DISCOVERY,
config_entries.SOURCE_INTEGRATION_DISCOVERY,
{CONF_HOST: IP_ADDRESS, CONF_MAC: MAC_ADDRESS, CONF_NAME: ALIAS},
),
],
@ -345,7 +345,7 @@ async def test_discovered_by_dhcp_or_discovery(hass, source, data):
dhcp.DhcpServiceInfo(ip=IP_ADDRESS, macaddress=MAC_ADDRESS, hostname=ALIAS),
),
(
config_entries.SOURCE_DISCOVERY,
config_entries.SOURCE_INTEGRATION_DISCOVERY,
{CONF_HOST: IP_ADDRESS, CONF_MAC: MAC_ADDRESS, CONF_NAME: ALIAS},
),
],