diff --git a/homeassistant/components/renault/config_flow.py b/homeassistant/components/renault/config_flow.py index 90d2c11613c..a7998af953a 100644 --- a/homeassistant/components/renault/config_flow.py +++ b/homeassistant/components/renault/config_flow.py @@ -64,9 +64,10 @@ class RenaultFlowHandler(ConfigFlow, domain=DOMAIN): if login_success: return await self.async_step_kamereon() errors["base"] = "invalid_credentials" + return self.async_show_form( step_id="user", - data_schema=USER_SCHEMA, + data_schema=self.add_suggested_values_to_schema(USER_SCHEMA, user_input), errors=errors, ) diff --git a/tests/components/renault/test_config_flow.py b/tests/components/renault/test_config_flow.py index 781b7efe226..9c3c82eaf3a 100644 --- a/tests/components/renault/test_config_flow.py +++ b/tests/components/renault/test_config_flow.py @@ -19,7 +19,7 @@ from homeassistant.core import HomeAssistant from homeassistant.data_entry_flow import FlowResultType from homeassistant.helpers import aiohttp_client -from tests.common import MockConfigEntry, load_fixture +from tests.common import MockConfigEntry, get_schema_suggested_value, load_fixture pytestmark = pytest.mark.usefixtures("mock_setup_entry") @@ -67,6 +67,11 @@ async def test_config_flow_single_account( assert result["step_id"] == "user" assert result["errors"] == {"base": error} + data_schema = result["data_schema"].schema + assert get_schema_suggested_value(data_schema, CONF_LOCALE) == "fr_FR" + assert get_schema_suggested_value(data_schema, CONF_USERNAME) == "email@test.com" + assert get_schema_suggested_value(data_schema, CONF_PASSWORD) == "test" + renault_account = AsyncMock() type(renault_account).account_id = PropertyMock(return_value="account_id_1") renault_account.get_vehicles.return_value = (