Skip to content

Commit

Permalink
Remove option to update settings using second config flow in Reolink (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
starkillerOG authored Dec 2, 2024
1 parent 4b9d89a commit 2f644eb
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 46 deletions.
2 changes: 1 addition & 1 deletion homeassistant/components/reolink/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ async def async_step_user(
return self.async_update_reload_and_abort(
entry=self._get_reconfigure_entry(), data=user_input
)
self._abort_if_unique_id_configured(updates=user_input)
self._abort_if_unique_id_configured()

return self.async_create_entry(
title=str(host.api.nvr_name),
Expand Down
45 changes: 0 additions & 45 deletions tests/components/reolink/test_config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,51 +286,6 @@ async def test_options_flow(hass: HomeAssistant, mock_setup_entry: MagicMock) ->
}


async def test_change_connection_settings(
hass: HomeAssistant, mock_setup_entry: MagicMock
) -> None:
"""Test changing connection settings by issuing a second user config flow."""
config_entry = MockConfigEntry(
domain=DOMAIN,
unique_id=format_mac(TEST_MAC),
data={
CONF_HOST: TEST_HOST,
CONF_USERNAME: TEST_USERNAME,
CONF_PASSWORD: TEST_PASSWORD,
CONF_PORT: TEST_PORT,
CONF_USE_HTTPS: TEST_USE_HTTPS,
},
options={
CONF_PROTOCOL: DEFAULT_PROTOCOL,
},
title=TEST_NVR_NAME,
)
config_entry.add_to_hass(hass)

result = await hass.config_entries.flow.async_init(
DOMAIN, context={"source": config_entries.SOURCE_USER}
)

assert result["type"] is FlowResultType.FORM
assert result["step_id"] == "user"
assert result["errors"] == {}

result = await hass.config_entries.flow.async_configure(
result["flow_id"],
{
CONF_HOST: TEST_HOST2,
CONF_USERNAME: TEST_USERNAME2,
CONF_PASSWORD: TEST_PASSWORD2,
},
)

assert result["type"] is FlowResultType.ABORT
assert result["reason"] == "already_configured"
assert config_entry.data[CONF_HOST] == TEST_HOST2
assert config_entry.data[CONF_USERNAME] == TEST_USERNAME2
assert config_entry.data[CONF_PASSWORD] == TEST_PASSWORD2


async def test_reauth(hass: HomeAssistant, mock_setup_entry: MagicMock) -> None:
"""Test a reauth flow."""
config_entry = MockConfigEntry(
Expand Down

0 comments on commit 2f644eb

Please sign in to comment.