mirror of
https://github.com/home-assistant/core.git
synced 2025-04-25 09:47:52 +00: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:
parent
1faabb8f40
commit
6d49362573
@ -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},
|
||||
)
|
||||
|
||||
|
@ -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",
|
||||
|
@ -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,
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user