From 6ae23318054282b3029706a68f186329a1ce8eed Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Tue, 15 Feb 2022 17:47:01 -0600 Subject: [PATCH] Switch senseme to use integration discovery (#66576) --- homeassistant/components/senseme/config_flow.py | 4 ++-- homeassistant/components/senseme/discovery.py | 2 +- tests/components/senseme/test_config_flow.py | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/homeassistant/components/senseme/config_flow.py b/homeassistant/components/senseme/config_flow.py index 151a251c8a2..6e2f10c1b36 100644 --- a/homeassistant/components/senseme/config_flow.py +++ b/homeassistant/components/senseme/config_flow.py @@ -42,10 +42,10 @@ class SensemeFlowHandler(config_entries.ConfigFlow, domain=DOMAIN): self._discovered_device = device return await self.async_step_discovery_confirm() - async def async_step_discovery( + async def async_step_integration_discovery( self, discovery_info: DiscoveryInfoType ) -> FlowResult: - """Handle discovery.""" + """Handle integration discovery.""" uuid = discovery_info[CONF_ID] device = async_get_discovered_device(self.hass, discovery_info[CONF_ID]) host = device.address diff --git a/homeassistant/components/senseme/discovery.py b/homeassistant/components/senseme/discovery.py index 85674f069e1..624b18a8761 100644 --- a/homeassistant/components/senseme/discovery.py +++ b/homeassistant/components/senseme/discovery.py @@ -58,7 +58,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_ID: device.uuid}, ) ) diff --git a/tests/components/senseme/test_config_flow.py b/tests/components/senseme/test_config_flow.py index 93a42d1e8ab..e85845dcace 100644 --- a/tests/components/senseme/test_config_flow.py +++ b/tests/components/senseme/test_config_flow.py @@ -211,7 +211,7 @@ async def test_discovery(hass: HomeAssistant) -> None: ) as mock_setup_entry: result = await hass.config_entries.flow.async_init( DOMAIN, - context={"source": config_entries.SOURCE_DISCOVERY}, + context={"source": config_entries.SOURCE_INTEGRATION_DISCOVERY}, data={CONF_ID: MOCK_UUID}, ) assert result["type"] == RESULT_TYPE_FORM @@ -254,7 +254,7 @@ async def test_discovery_existing_device_no_ip_change(hass: HomeAssistant) -> No with _patch_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_ID: MOCK_UUID}, ) assert result["type"] == RESULT_TYPE_ABORT @@ -281,7 +281,7 @@ async def test_discovery_existing_device_ip_change(hass: HomeAssistant) -> None: result = await hass.config_entries.flow.async_init( DOMAIN, - context={"source": config_entries.SOURCE_DISCOVERY}, + context={"source": config_entries.SOURCE_INTEGRATION_DISCOVERY}, data={CONF_ID: MOCK_UUID}, ) await hass.async_block_till_done()