mirror of
https://github.com/home-assistant/core.git
synced 2025-04-25 09:47:52 +00:00
Standardize reauth step variable name in permobil (#124764)
This commit is contained in:
parent
51a5a78eb5
commit
274d98f4d7
@ -161,17 +161,12 @@ class PermobilConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
return self.async_create_entry(title=self.data[CONF_EMAIL], data=self.data)
|
return self.async_create_entry(title=self.data[CONF_EMAIL], data=self.data)
|
||||||
|
|
||||||
async def async_step_reauth(
|
async def async_step_reauth(
|
||||||
self, user_input: Mapping[str, Any]
|
self, entry_data: Mapping[str, Any]
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
"""Perform reauth upon an API authentication error."""
|
"""Perform reauth upon an API authentication error."""
|
||||||
reauth_entry = self.hass.config_entries.async_get_entry(
|
|
||||||
self.context["entry_id"]
|
|
||||||
)
|
|
||||||
assert reauth_entry
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
email: str = reauth_entry.data[CONF_EMAIL]
|
email: str = entry_data[CONF_EMAIL]
|
||||||
region: str = reauth_entry.data[CONF_REGION]
|
region: str = entry_data[CONF_REGION]
|
||||||
self.p_api.set_email(email)
|
self.p_api.set_email(email)
|
||||||
self.p_api.set_region(region)
|
self.p_api.set_region(region)
|
||||||
self.data = {
|
self.data = {
|
||||||
|
@ -287,6 +287,7 @@ async def test_config_flow_reauth_success(
|
|||||||
result = await hass.config_entries.flow.async_init(
|
result = await hass.config_entries.flow.async_init(
|
||||||
config_flow.DOMAIN,
|
config_flow.DOMAIN,
|
||||||
context={"source": "reauth", "entry_id": mock_entry.entry_id},
|
context={"source": "reauth", "entry_id": mock_entry.entry_id},
|
||||||
|
data=mock_entry.data,
|
||||||
)
|
)
|
||||||
|
|
||||||
assert result["type"] is FlowResultType.FORM
|
assert result["type"] is FlowResultType.FORM
|
||||||
@ -329,6 +330,7 @@ async def test_config_flow_reauth_fail_invalid_code(
|
|||||||
result = await hass.config_entries.flow.async_init(
|
result = await hass.config_entries.flow.async_init(
|
||||||
config_flow.DOMAIN,
|
config_flow.DOMAIN,
|
||||||
context={"source": "reauth", "entry_id": mock_entry.entry_id},
|
context={"source": "reauth", "entry_id": mock_entry.entry_id},
|
||||||
|
data=mock_entry.data,
|
||||||
)
|
)
|
||||||
|
|
||||||
assert result["type"] is FlowResultType.FORM
|
assert result["type"] is FlowResultType.FORM
|
||||||
@ -366,6 +368,7 @@ async def test_config_flow_reauth_fail_code_request(
|
|||||||
result = await hass.config_entries.flow.async_init(
|
result = await hass.config_entries.flow.async_init(
|
||||||
config_flow.DOMAIN,
|
config_flow.DOMAIN,
|
||||||
context={"source": "reauth", "entry_id": reauth_entry.entry_id},
|
context={"source": "reauth", "entry_id": reauth_entry.entry_id},
|
||||||
|
data=mock_entry.data,
|
||||||
)
|
)
|
||||||
|
|
||||||
assert result["type"] is FlowResultType.ABORT
|
assert result["type"] is FlowResultType.ABORT
|
||||||
|
Loading…
x
Reference in New Issue
Block a user