From b28754e5fef1450e3b0e20a6a160cd1257cceea3 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Tue, 15 Feb 2022 16:18:13 -0600 Subject: [PATCH] Switch steamist to use integration discovery (#66578) --- homeassistant/components/steamist/config_flow.py | 4 ++-- homeassistant/components/steamist/discovery.py | 2 +- tests/components/steamist/test_config_flow.py | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/homeassistant/components/steamist/config_flow.py b/homeassistant/components/steamist/config_flow.py index 00d87bf9837..c0ec18157b6 100644 --- a/homeassistant/components/steamist/config_flow.py +++ b/homeassistant/components/steamist/config_flow.py @@ -48,10 +48,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 = Device30303( ipaddress=discovery_info["ipaddress"], name=discovery_info["name"], diff --git a/homeassistant/components/steamist/discovery.py b/homeassistant/components/steamist/discovery.py index 2ecd2a1d681..773e56d6612 100644 --- a/homeassistant/components/steamist/discovery.py +++ b/homeassistant/components/steamist/discovery.py @@ -125,7 +125,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={ "ipaddress": device.ipaddress, "name": device.name, diff --git a/tests/components/steamist/test_config_flow.py b/tests/components/steamist/test_config_flow.py index 7876272368a..ed887bb6049 100644 --- a/tests/components/steamist/test_config_flow.py +++ b/tests/components/steamist/test_config_flow.py @@ -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): result = await hass.config_entries.flow.async_init( DOMAIN, - context={"source": config_entries.SOURCE_DISCOVERY}, + context={"source": config_entries.SOURCE_INTEGRATION_DISCOVERY}, data=DISCOVERY_30303, ) 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): result = await hass.config_entries.flow.async_init( DOMAIN, - context={"source": config_entries.SOURCE_DISCOVERY}, + context={"source": config_entries.SOURCE_INTEGRATION_DISCOVERY}, data=DISCOVERY_30303, ) await hass.async_block_till_done() @@ -339,7 +339,7 @@ async def test_discovered_by_dhcp_discovery_finds_non_steamist_device( "source, data", [ (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( @@ -371,7 +371,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, DISCOVERY_30303), + (config_entries.SOURCE_INTEGRATION_DISCOVERY, DISCOVERY_30303), ], ) async def test_discovered_by_dhcp_or_discovery_existing_unique_id_does_not_reload(