Switch senseme to use integration discovery (#66576)
This commit is contained in:
parent
dd9992bfd6
commit
6ae2331805
3 changed files with 6 additions and 6 deletions
|
@ -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
|
||||
|
|
|
@ -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},
|
||||
)
|
||||
)
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Add table
Reference in a new issue