Switch flux_led to use integration discovery (#66574)

This commit is contained in:
J. Nick Koston 2022-02-15 18:25:43 -06:00 committed by GitHub
parent 208671418e
commit 99568b133f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 7 deletions

View file

@ -81,10 +81,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 = cast(FluxLEDDiscovery, discovery_info)
return await self._async_handle_discovery()

View file

@ -213,7 +213,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={**device},
)
)

View file

@ -382,7 +382,7 @@ async def test_discovered_by_discovery_and_dhcp(hass):
with _patch_discovery(), _patch_wifibulb():
result = await hass.config_entries.flow.async_init(
DOMAIN,
context={"source": config_entries.SOURCE_DISCOVERY},
context={"source": config_entries.SOURCE_INTEGRATION_DISCOVERY},
data=FLUX_DISCOVERY,
)
await hass.async_block_till_done()
@ -420,7 +420,7 @@ async def test_discovered_by_discovery(hass):
with _patch_discovery(), _patch_wifibulb():
result = await hass.config_entries.flow.async_init(
DOMAIN,
context={"source": config_entries.SOURCE_DISCOVERY},
context={"source": config_entries.SOURCE_INTEGRATION_DISCOVERY},
data=FLUX_DISCOVERY,
)
await hass.async_block_till_done()
@ -567,7 +567,7 @@ async def test_discovered_by_dhcp_no_udp_response_or_tcp_response(hass):
"source, data",
[
(config_entries.SOURCE_DHCP, DHCP_DISCOVERY),
(config_entries.SOURCE_DISCOVERY, FLUX_DISCOVERY),
(config_entries.SOURCE_INTEGRATION_DISCOVERY, FLUX_DISCOVERY),
],
)
async def test_discovered_by_dhcp_or_discovery_adds_missing_unique_id(
@ -593,7 +593,7 @@ async def test_discovered_by_dhcp_or_discovery_adds_missing_unique_id(
"source, data",
[
(config_entries.SOURCE_DHCP, DHCP_DISCOVERY),
(config_entries.SOURCE_DISCOVERY, FLUX_DISCOVERY),
(config_entries.SOURCE_INTEGRATION_DISCOVERY, FLUX_DISCOVERY),
],
)
async def test_discovered_by_dhcp_or_discovery_mac_address_mismatch_host_already_configured(