From e9a71a8d7f9470441bb190714f8f35d8acb32faf Mon Sep 17 00:00:00 2001 From: Joost Lekkerkerker Date: Wed, 11 Jun 2025 10:31:08 +0200 Subject: [PATCH] Explain Nest setup (#146217) --- homeassistant/components/nest/config_flow.py | 8 -------- homeassistant/components/nest/strings.json | 3 +++ tests/components/nest/test_config_flow.py | 8 ++++++++ 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/homeassistant/components/nest/config_flow.py b/homeassistant/components/nest/config_flow.py index 1513a039407..0b249db7a4b 100644 --- a/homeassistant/components/nest/config_flow.py +++ b/homeassistant/components/nest/config_flow.py @@ -31,7 +31,6 @@ from homeassistant.helpers.selector import ( SelectSelectorConfig, SelectSelectorMode, ) -from homeassistant.helpers.service_info.dhcp import DhcpServiceInfo from homeassistant.util import get_random_string from . import api @@ -441,10 +440,3 @@ class NestFlowHandler( if self._structure_config_title: title = self._structure_config_title return self.async_create_entry(title=title, data=self._data) - - async def async_step_dhcp( - self, discovery_info: DhcpServiceInfo - ) -> ConfigFlowResult: - """Handle a flow initialized by discovery.""" - await self._async_handle_discovery_without_unique_id() - return await self.async_step_user() diff --git a/homeassistant/components/nest/strings.json b/homeassistant/components/nest/strings.json index 4a8689ff04c..5146d04af0b 100644 --- a/homeassistant/components/nest/strings.json +++ b/homeassistant/components/nest/strings.json @@ -47,6 +47,9 @@ "reauth_confirm": { "title": "[%key:common::config_flow::title::reauth%]", "description": "The Nest integration needs to re-authenticate your account" + }, + "oauth_discovery": { + "description": "Home Assistant has found a Google Nest device on your network. Be aware that the set up of Google Nest is more complicated than most other integrations and requires setting up a Nest Device Access project which **requires paying Google a US $5 fee**. Press **Submit** to continue setting up Google Nest." } }, "error": { diff --git a/tests/components/nest/test_config_flow.py b/tests/components/nest/test_config_flow.py index 3f369f3e127..67364aff412 100644 --- a/tests/components/nest/test_config_flow.py +++ b/tests/components/nest/test_config_flow.py @@ -995,6 +995,10 @@ async def test_dhcp_discovery( ) await hass.async_block_till_done() assert result["type"] is FlowResultType.FORM + assert result["step_id"] == "oauth_discovery" + + result = await oauth.async_configure(result, {}) + assert result["type"] is FlowResultType.FORM assert result["step_id"] == "create_cloud_project" result = await oauth.async_configure(result, {}) @@ -1033,6 +1037,10 @@ async def test_dhcp_discovery_with_creds( ) await hass.async_block_till_done() assert result.get("type") is FlowResultType.FORM + assert result.get("step_id") == "oauth_discovery" + + result = await oauth.async_configure(result, {}) + assert result.get("type") is FlowResultType.FORM assert result.get("step_id") == "cloud_project" result = await oauth.async_configure(result, {"cloud_project_id": CLOUD_PROJECT_ID})