1
mirror of https://github.com/home-assistant/core synced 2024-08-02 23:40:32 +02:00

Revert rename of confirm step in zha config flow (#77010)

* Revert rename of confirm step in zha config flow

* Update tests
This commit is contained in:
Erik Montnemery 2022-08-19 09:33:57 +02:00 committed by GitHub
parent 1faabb8f40
commit 6d49362573
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 9 deletions

View File

@ -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},
)

View File

@ -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",

View File

@ -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,

View File

@ -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)