mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Switch steamist to use integration discovery (#66578)
This commit is contained in:
parent
c6a4139716
commit
b28754e5fe
@ -48,10 +48,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 = Device30303(
|
self._discovered_device = Device30303(
|
||||||
ipaddress=discovery_info["ipaddress"],
|
ipaddress=discovery_info["ipaddress"],
|
||||||
name=discovery_info["name"],
|
name=discovery_info["name"],
|
||||||
|
@ -125,7 +125,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={
|
data={
|
||||||
"ipaddress": device.ipaddress,
|
"ipaddress": device.ipaddress,
|
||||||
"name": device.name,
|
"name": device.name,
|
||||||
|
@ -211,7 +211,7 @@ async def test_discovered_by_discovery_and_dhcp(hass: HomeAssistant) -> None:
|
|||||||
with _patch_discovery(), _patch_status(MOCK_ASYNC_GET_STATUS_INACTIVE):
|
with _patch_discovery(), _patch_status(MOCK_ASYNC_GET_STATUS_INACTIVE):
|
||||||
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=DISCOVERY_30303,
|
data=DISCOVERY_30303,
|
||||||
)
|
)
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
@ -249,7 +249,7 @@ async def test_discovered_by_discovery(hass: HomeAssistant) -> None:
|
|||||||
with _patch_discovery(), _patch_status(MOCK_ASYNC_GET_STATUS_INACTIVE):
|
with _patch_discovery(), _patch_status(MOCK_ASYNC_GET_STATUS_INACTIVE):
|
||||||
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=DISCOVERY_30303,
|
data=DISCOVERY_30303,
|
||||||
)
|
)
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
@ -339,7 +339,7 @@ async def test_discovered_by_dhcp_discovery_finds_non_steamist_device(
|
|||||||
"source, data",
|
"source, data",
|
||||||
[
|
[
|
||||||
(config_entries.SOURCE_DHCP, DHCP_DISCOVERY),
|
(config_entries.SOURCE_DHCP, DHCP_DISCOVERY),
|
||||||
(config_entries.SOURCE_DISCOVERY, DISCOVERY_30303),
|
(config_entries.SOURCE_INTEGRATION_DISCOVERY, DISCOVERY_30303),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
async def test_discovered_by_dhcp_or_discovery_adds_missing_unique_id(
|
async def test_discovered_by_dhcp_or_discovery_adds_missing_unique_id(
|
||||||
@ -371,7 +371,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, DISCOVERY_30303),
|
(config_entries.SOURCE_INTEGRATION_DISCOVERY, DISCOVERY_30303),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
async def test_discovered_by_dhcp_or_discovery_existing_unique_id_does_not_reload(
|
async def test_discovered_by_dhcp_or_discovery_existing_unique_id_does_not_reload(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user