From 6d49362573e00cba77431438b20b81b39b9bd58f Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Fri, 19 Aug 2022 09:33:57 +0200 Subject: [PATCH] Revert rename of confirm step in zha config flow (#77010) * Revert rename of confirm step in zha config flow * Update tests --- homeassistant/components/zha/config_flow.py | 6 +++--- homeassistant/components/zha/strings.json | 3 +++ .../homeassistant_sky_connect/test_config_flow.py | 2 -- tests/components/zha/test_config_flow.py | 8 ++++---- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/homeassistant/components/zha/config_flow.py b/homeassistant/components/zha/config_flow.py index 4b90fdb3ad0..9c7ec46a386 100644 --- a/homeassistant/components/zha/config_flow.py +++ b/homeassistant/components/zha/config_flow.py @@ -138,9 +138,9 @@ class ZhaFlowHandler(config_entries.ConfigFlow, domain=DOMAIN): ) self._set_confirm_only() self.context["title_placeholders"] = {CONF_NAME: self._title} - return await self.async_step_confirm_usb() + return await self.async_step_confirm() - async def async_step_confirm_usb(self, user_input=None): + async def async_step_confirm(self, user_input=None): """Confirm a USB discovery.""" if user_input is not None or not onboarding.async_is_onboarded(self.hass): auto_detected_data = await detect_radios(self._device_path) @@ -155,7 +155,7 @@ class ZhaFlowHandler(config_entries.ConfigFlow, domain=DOMAIN): ) return self.async_show_form( - step_id="confirm_usb", + step_id="confirm", description_placeholders={CONF_NAME: self._title}, ) diff --git a/homeassistant/components/zha/strings.json b/homeassistant/components/zha/strings.json index 4eb872f4fae..37be80e9b56 100644 --- a/homeassistant/components/zha/strings.json +++ b/homeassistant/components/zha/strings.json @@ -10,6 +10,9 @@ "confirm": { "description": "Do you want to setup {name}?" }, + "confirm_hardware": { + "description": "Do you want to setup {name}?" + }, "pick_radio": { "data": { "radio_type": "Radio Type" }, "title": "Radio Type", diff --git a/tests/components/homeassistant_sky_connect/test_config_flow.py b/tests/components/homeassistant_sky_connect/test_config_flow.py index 1db305f3ad0..bbde732d201 100644 --- a/tests/components/homeassistant_sky_connect/test_config_flow.py +++ b/tests/components/homeassistant_sky_connect/test_config_flow.py @@ -21,8 +21,6 @@ USB_DATA = usb.UsbServiceInfo( async def test_config_flow(hass: HomeAssistant) -> None: """Test the config flow.""" - # mock_integration(hass, MockModule("hassio")) - with patch( "homeassistant.components.homeassistant_sky_connect.async_setup_entry", return_value=True, diff --git a/tests/components/zha/test_config_flow.py b/tests/components/zha/test_config_flow.py index 82c2fde7c1e..a769303a4c4 100644 --- a/tests/components/zha/test_config_flow.py +++ b/tests/components/zha/test_config_flow.py @@ -228,7 +228,7 @@ async def test_discovery_via_usb(detect_mock, hass): ) await hass.async_block_till_done() assert result["type"] == FlowResultType.FORM - assert result["step_id"] == "confirm_usb" + assert result["step_id"] == "confirm" with patch("homeassistant.components.zha.async_setup_entry"): result2 = await hass.config_entries.flow.async_configure( @@ -264,7 +264,7 @@ async def test_zigate_discovery_via_usb(detect_mock, hass): ) await hass.async_block_till_done() assert result["type"] == FlowResultType.FORM - assert result["step_id"] == "confirm_usb" + assert result["step_id"] == "confirm" with patch("homeassistant.components.zha.async_setup_entry"): result2 = await hass.config_entries.flow.async_configure( @@ -298,7 +298,7 @@ async def test_discovery_via_usb_no_radio(detect_mock, hass): ) await hass.async_block_till_done() assert result["type"] == FlowResultType.FORM - assert result["step_id"] == "confirm_usb" + assert result["step_id"] == "confirm" with patch("homeassistant.components.zha.async_setup_entry"): result2 = await hass.config_entries.flow.async_configure( @@ -451,7 +451,7 @@ async def test_discovery_via_usb_deconz_ignored(detect_mock, hass): await hass.async_block_till_done() assert result["type"] == FlowResultType.FORM - assert result["step_id"] == "confirm_usb" + assert result["step_id"] == "confirm" @patch("zigpy_znp.zigbee.application.ControllerApplication.probe", return_value=True)