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._set_confirm_only()
self.context["title_placeholders"] = {CONF_NAME: self._title} 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.""" """Confirm a USB discovery."""
if user_input is not None or not onboarding.async_is_onboarded(self.hass): if user_input is not None or not onboarding.async_is_onboarded(self.hass):
auto_detected_data = await detect_radios(self._device_path) 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( return self.async_show_form(
step_id="confirm_usb", step_id="confirm",
description_placeholders={CONF_NAME: self._title}, description_placeholders={CONF_NAME: self._title},
) )

View File

@ -10,6 +10,9 @@
"confirm": { "confirm": {
"description": "Do you want to setup {name}?" "description": "Do you want to setup {name}?"
}, },
"confirm_hardware": {
"description": "Do you want to setup {name}?"
},
"pick_radio": { "pick_radio": {
"data": { "radio_type": "Radio Type" }, "data": { "radio_type": "Radio Type" },
"title": "Radio Type", "title": "Radio Type",

View File

@ -21,8 +21,6 @@ USB_DATA = usb.UsbServiceInfo(
async def test_config_flow(hass: HomeAssistant) -> None: async def test_config_flow(hass: HomeAssistant) -> None:
"""Test the config flow.""" """Test the config flow."""
# mock_integration(hass, MockModule("hassio"))
with patch( with patch(
"homeassistant.components.homeassistant_sky_connect.async_setup_entry", "homeassistant.components.homeassistant_sky_connect.async_setup_entry",
return_value=True, return_value=True,

View File

@ -228,7 +228,7 @@ async def test_discovery_via_usb(detect_mock, hass):
) )
await hass.async_block_till_done() await hass.async_block_till_done()
assert result["type"] == FlowResultType.FORM assert result["type"] == FlowResultType.FORM
assert result["step_id"] == "confirm_usb" assert result["step_id"] == "confirm"
with patch("homeassistant.components.zha.async_setup_entry"): with patch("homeassistant.components.zha.async_setup_entry"):
result2 = await hass.config_entries.flow.async_configure( 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() await hass.async_block_till_done()
assert result["type"] == FlowResultType.FORM assert result["type"] == FlowResultType.FORM
assert result["step_id"] == "confirm_usb" assert result["step_id"] == "confirm"
with patch("homeassistant.components.zha.async_setup_entry"): with patch("homeassistant.components.zha.async_setup_entry"):
result2 = await hass.config_entries.flow.async_configure( 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() await hass.async_block_till_done()
assert result["type"] == FlowResultType.FORM assert result["type"] == FlowResultType.FORM
assert result["step_id"] == "confirm_usb" assert result["step_id"] == "confirm"
with patch("homeassistant.components.zha.async_setup_entry"): with patch("homeassistant.components.zha.async_setup_entry"):
result2 = await hass.config_entries.flow.async_configure( 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() await hass.async_block_till_done()
assert result["type"] == FlowResultType.FORM 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) @patch("zigpy_znp.zigbee.application.ControllerApplication.probe", return_value=True)