mirror of
https://github.com/home-assistant/core.git
synced 2025-07-15 09:17:10 +00:00
Handle Google Nest DHCP flows (#145658)
* Handle Google Nest DHCP flows * Handle Google Nest DHCP flows
This commit is contained in:
parent
1e3d06a993
commit
df35f30321
@ -446,4 +446,5 @@ class NestFlowHandler(
|
|||||||
self, discovery_info: DhcpServiceInfo
|
self, discovery_info: DhcpServiceInfo
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
"""Handle a flow initialized by discovery."""
|
"""Handle a flow initialized by discovery."""
|
||||||
|
await self._async_handle_discovery_without_unique_id()
|
||||||
return await self.async_step_user()
|
return await self.async_step_user()
|
||||||
|
@ -1002,6 +1002,24 @@ async def test_dhcp_discovery(
|
|||||||
assert result.get("reason") == "missing_credentials"
|
assert result.get("reason") == "missing_credentials"
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.parametrize(
|
||||||
|
("nest_test_config", "sdm_managed_topic", "device_access_project_id"),
|
||||||
|
[(TEST_CONFIG_APP_CREDS, True, "project-id-2")],
|
||||||
|
)
|
||||||
|
async def test_dhcp_discovery_already_setup(
|
||||||
|
hass: HomeAssistant, oauth: OAuthFixture, setup_platform
|
||||||
|
) -> None:
|
||||||
|
"""Exercise discovery dhcp with existing config entry."""
|
||||||
|
await setup_platform()
|
||||||
|
result = await hass.config_entries.flow.async_init(
|
||||||
|
DOMAIN,
|
||||||
|
context={"source": config_entries.SOURCE_DHCP},
|
||||||
|
data=FAKE_DHCP_DATA,
|
||||||
|
)
|
||||||
|
assert result["type"] is FlowResultType.ABORT
|
||||||
|
assert result["reason"] == "already_configured"
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize(("sdm_managed_topic"), [(True)])
|
@pytest.mark.parametrize(("sdm_managed_topic"), [(True)])
|
||||||
async def test_dhcp_discovery_with_creds(
|
async def test_dhcp_discovery_with_creds(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user