Switch flux_led to use integration discovery (#66574)
This commit is contained in:
parent
208671418e
commit
99568b133f
3 changed files with 7 additions and 7 deletions
|
@ -81,10 +81,10 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
||||||
)
|
)
|
||||||
return await self._async_handle_discovery()
|
return await self._async_handle_discovery()
|
||||||
|
|
||||||
async def async_step_discovery(
|
async def async_step_integration_discovery(
|
||||||
self, discovery_info: DiscoveryInfoType
|
self, discovery_info: DiscoveryInfoType
|
||||||
) -> FlowResult:
|
) -> FlowResult:
|
||||||
"""Handle discovery."""
|
"""Handle integration discovery."""
|
||||||
self._discovered_device = cast(FluxLEDDiscovery, discovery_info)
|
self._discovered_device = cast(FluxLEDDiscovery, discovery_info)
|
||||||
return await self._async_handle_discovery()
|
return await self._async_handle_discovery()
|
||||||
|
|
||||||
|
|
|
@ -213,7 +213,7 @@ def async_trigger_discovery(
|
||||||
hass.async_create_task(
|
hass.async_create_task(
|
||||||
hass.config_entries.flow.async_init(
|
hass.config_entries.flow.async_init(
|
||||||
DOMAIN,
|
DOMAIN,
|
||||||
context={"source": config_entries.SOURCE_DISCOVERY},
|
context={"source": config_entries.SOURCE_INTEGRATION_DISCOVERY},
|
||||||
data={**device},
|
data={**device},
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
|
@ -382,7 +382,7 @@ async def test_discovered_by_discovery_and_dhcp(hass):
|
||||||
with _patch_discovery(), _patch_wifibulb():
|
with _patch_discovery(), _patch_wifibulb():
|
||||||
result = await hass.config_entries.flow.async_init(
|
result = await hass.config_entries.flow.async_init(
|
||||||
DOMAIN,
|
DOMAIN,
|
||||||
context={"source": config_entries.SOURCE_DISCOVERY},
|
context={"source": config_entries.SOURCE_INTEGRATION_DISCOVERY},
|
||||||
data=FLUX_DISCOVERY,
|
data=FLUX_DISCOVERY,
|
||||||
)
|
)
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
|
@ -420,7 +420,7 @@ async def test_discovered_by_discovery(hass):
|
||||||
with _patch_discovery(), _patch_wifibulb():
|
with _patch_discovery(), _patch_wifibulb():
|
||||||
result = await hass.config_entries.flow.async_init(
|
result = await hass.config_entries.flow.async_init(
|
||||||
DOMAIN,
|
DOMAIN,
|
||||||
context={"source": config_entries.SOURCE_DISCOVERY},
|
context={"source": config_entries.SOURCE_INTEGRATION_DISCOVERY},
|
||||||
data=FLUX_DISCOVERY,
|
data=FLUX_DISCOVERY,
|
||||||
)
|
)
|
||||||
await hass.async_block_till_done()
|
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",
|
"source, data",
|
||||||
[
|
[
|
||||||
(config_entries.SOURCE_DHCP, DHCP_DISCOVERY),
|
(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(
|
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",
|
"source, data",
|
||||||
[
|
[
|
||||||
(config_entries.SOURCE_DHCP, DHCP_DISCOVERY),
|
(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(
|
async def test_discovered_by_dhcp_or_discovery_mac_address_mismatch_host_already_configured(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue