Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix reauth config flow title #129134

Draft
wants to merge 12 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions homeassistant/components/aosmith/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import voluptuous as vol

from homeassistant.config_entries import ConfigFlow, ConfigFlowResult
from homeassistant.const import CONF_EMAIL, CONF_PASSWORD
from homeassistant.const import CONF_EMAIL, CONF_NAME, CONF_PASSWORD
from homeassistant.helpers import aiohttp_client

from .const import DOMAIN
Expand Down Expand Up @@ -99,6 +99,9 @@ async def async_step_reauth_confirm(
return self.async_show_form(
step_id="reauth_confirm",
data_schema=vol.Schema({vol.Required(CONF_PASSWORD): str}),
description_placeholders={CONF_EMAIL: self._reauth_email},
description_placeholders={
CONF_EMAIL: self._reauth_email,
CONF_NAME: self._get_reauth_entry().title,
},
errors=errors,
)
7 changes: 5 additions & 2 deletions homeassistant/components/aussie_broadband/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import voluptuous as vol

from homeassistant.config_entries import ConfigFlow, ConfigFlowResult
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
from homeassistant.const import CONF_NAME, CONF_PASSWORD, CONF_USERNAME
from homeassistant.helpers.aiohttp_client import async_get_clientsession

from .const import CONF_SERVICES, DOMAIN
Expand Down Expand Up @@ -105,7 +105,10 @@ async def async_step_reauth_confirm(

return self.async_show_form(
step_id="reauth_confirm",
description_placeholders={"username": self._reauth_username},
description_placeholders={
CONF_NAME: self._get_reauth_entry().title,
"username": self._reauth_username,
CFenner marked this conversation as resolved.
Show resolved Hide resolved
},
data_schema=vol.Schema(
{
vol.Required(CONF_PASSWORD): str,
Expand Down
6 changes: 5 additions & 1 deletion homeassistant/components/electric_kiwi/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from typing import Any

from homeassistant.config_entries import ConfigFlowResult
from homeassistant.const import CONF_NAME
from homeassistant.helpers import config_entry_oauth2_flow

from .const import DOMAIN, SCOPE_VALUES
Expand Down Expand Up @@ -40,7 +41,10 @@ async def async_step_reauth_confirm(
) -> ConfigFlowResult:
"""Dialog that informs the user that reauth is required."""
if user_input is None:
return self.async_show_form(step_id="reauth_confirm")
return self.async_show_form(
step_id="reauth_confirm",
description_placeholders={CONF_NAME: self._get_reauth_entry().title},
)
return await self.async_step_user()

async def async_oauth_create_entry(self, data: dict) -> ConfigFlowResult:
Expand Down
7 changes: 5 additions & 2 deletions homeassistant/components/fitbit/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from typing import Any

from homeassistant.config_entries import SOURCE_REAUTH, ConfigFlowResult
from homeassistant.const import CONF_TOKEN
from homeassistant.const import CONF_NAME, CONF_TOKEN
from homeassistant.helpers import config_entry_oauth2_flow

from . import api
Expand Down Expand Up @@ -46,7 +46,10 @@ async def async_step_reauth_confirm(
) -> ConfigFlowResult:
"""Confirm reauth dialog."""
if user_input is None:
return self.async_show_form(step_id="reauth_confirm")
return self.async_show_form(
step_id="reauth_confirm",
description_placeholders={CONF_NAME: self._get_reauth_entry().title},
)
return await self.async_step_user()

async def async_step_creation(
Expand Down
6 changes: 5 additions & 1 deletion homeassistant/components/geocaching/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from geocachingapi.geocachingapi import GeocachingApi

from homeassistant.config_entries import ConfigFlowResult
from homeassistant.const import CONF_NAME
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from homeassistant.helpers.config_entry_oauth2_flow import AbstractOAuth2FlowHandler

Expand Down Expand Up @@ -37,7 +38,10 @@ async def async_step_reauth_confirm(
) -> ConfigFlowResult:
"""Dialog that informs the user that reauth is required."""
if user_input is None:
return self.async_show_form(step_id="reauth_confirm")
return self.async_show_form(
step_id="reauth_confirm",
description_placeholders={CONF_NAME: self._get_reauth_entry().title},
)
return await self.async_step_user()

async def async_oauth_create_entry(self, data: dict[str, Any]) -> ConfigFlowResult:
Expand Down
6 changes: 5 additions & 1 deletion homeassistant/components/google/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
ConfigFlowResult,
OptionsFlow,
)
from homeassistant.const import CONF_NAME
from homeassistant.core import callback
from homeassistant.helpers import config_entry_oauth2_flow
from homeassistant.helpers.aiohttp_client import async_get_clientsession
Expand Down Expand Up @@ -229,7 +230,10 @@ async def async_step_reauth_confirm(
) -> ConfigFlowResult:
"""Confirm reauth dialog."""
if user_input is None:
return self.async_show_form(step_id="reauth_confirm")
return self.async_show_form(
step_id="reauth_confirm",
description_placeholders={CONF_NAME: self._get_reauth_entry().title},
)
return await self.async_step_user()

@staticmethod
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
ConfigFlowResult,
OptionsFlow,
)
from homeassistant.const import CONF_NAME
from homeassistant.core import callback
from homeassistant.helpers import config_entry_oauth2_flow

Expand Down Expand Up @@ -56,7 +57,10 @@ async def async_step_reauth_confirm(
) -> ConfigFlowResult:
"""Confirm reauth dialog."""
if user_input is None:
return self.async_show_form(step_id="reauth_confirm")
return self.async_show_form(
step_id="reauth_confirm",
description_placeholders={CONF_NAME: self._get_reauth_entry().title},
)
return await self.async_step_user()

async def async_oauth_create_entry(self, data: dict[str, Any]) -> ConfigFlowResult:
Expand Down
7 changes: 5 additions & 2 deletions homeassistant/components/google_mail/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from googleapiclient.discovery import build

from homeassistant.config_entries import SOURCE_REAUTH, ConfigFlowResult
from homeassistant.const import CONF_ACCESS_TOKEN, CONF_TOKEN
from homeassistant.const import CONF_ACCESS_TOKEN, CONF_NAME, CONF_TOKEN
from homeassistant.helpers import config_entry_oauth2_flow

from .const import DEFAULT_ACCESS, DOMAIN
Expand Down Expand Up @@ -49,7 +49,10 @@ async def async_step_reauth_confirm(
) -> ConfigFlowResult:
"""Confirm reauth dialog."""
if user_input is None:
return self.async_show_form(step_id="reauth_confirm")
return self.async_show_form(
step_id="reauth_confirm",
description_placeholders={CONF_NAME: self._get_reauth_entry().title},
)
return await self.async_step_user()

async def async_oauth_create_entry(self, data: dict[str, Any]) -> ConfigFlowResult:
Expand Down
7 changes: 5 additions & 2 deletions homeassistant/components/google_sheets/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from gspread import Client, GSpreadException

from homeassistant.config_entries import SOURCE_REAUTH, ConfigFlowResult
from homeassistant.const import CONF_ACCESS_TOKEN, CONF_TOKEN
from homeassistant.const import CONF_ACCESS_TOKEN, CONF_NAME, CONF_TOKEN
from homeassistant.helpers import config_entry_oauth2_flow

from .const import DEFAULT_ACCESS, DEFAULT_NAME, DOMAIN
Expand Down Expand Up @@ -51,7 +51,10 @@ async def async_step_reauth_confirm(
) -> ConfigFlowResult:
"""Confirm reauth dialog."""
if user_input is None:
return self.async_show_form(step_id="reauth_confirm")
return self.async_show_form(
step_id="reauth_confirm",
description_placeholders={CONF_NAME: self._get_reauth_entry().title},
)
return await self.async_step_user()

async def async_oauth_create_entry(self, data: dict[str, Any]) -> ConfigFlowResult:
Expand Down
7 changes: 5 additions & 2 deletions homeassistant/components/jellyfin/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
ConfigFlowResult,
OptionsFlowWithConfigEntry,
)
from homeassistant.const import CONF_PASSWORD, CONF_URL, CONF_USERNAME
from homeassistant.const import CONF_NAME, CONF_PASSWORD, CONF_URL, CONF_USERNAME
from homeassistant.core import callback
from homeassistant.util.uuid import random_uuid_hex

Expand Down Expand Up @@ -136,7 +136,10 @@ async def async_step_reauth_confirm(
return self.async_update_reload_and_abort(reauth_entry, data=new_input)

return self.async_show_form(
step_id="reauth_confirm", data_schema=REAUTH_DATA_SCHEMA, errors=errors
step_id="reauth_confirm",
data_schema=REAUTH_DATA_SCHEMA,
description_placeholders={CONF_NAME: self._get_reauth_entry().title},
CFenner marked this conversation as resolved.
Show resolved Hide resolved
errors=errors,
)

@staticmethod
Expand Down
6 changes: 5 additions & 1 deletion homeassistant/components/lyric/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from typing import Any

from homeassistant.config_entries import ConfigFlowResult
from homeassistant.const import CONF_NAME
from homeassistant.helpers import config_entry_oauth2_flow

from .const import DOMAIN
Expand Down Expand Up @@ -35,7 +36,10 @@ async def async_step_reauth_confirm(
) -> ConfigFlowResult:
"""Dialog that informs the user that reauth is required."""
if user_input is None:
return self.async_show_form(step_id="reauth_confirm")
return self.async_show_form(
step_id="reauth_confirm",
description_placeholders={CONF_NAME: self._get_reauth_entry().title},
)
return await self.async_step_user()

async def async_oauth_create_entry(self, data: dict[str, Any]) -> ConfigFlowResult:
Expand Down
3 changes: 2 additions & 1 deletion homeassistant/components/melcloud/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import voluptuous as vol

from homeassistant.config_entries import ConfigFlow, ConfigFlowResult
from homeassistant.const import CONF_PASSWORD, CONF_TOKEN, CONF_USERNAME
from homeassistant.const import CONF_NAME, CONF_PASSWORD, CONF_TOKEN, CONF_USERNAME
from homeassistant.helpers.aiohttp_client import async_get_clientsession

from .const import DOMAIN
Expand Down Expand Up @@ -101,6 +101,7 @@ async def async_step_reauth_confirm(
data_schema=vol.Schema(
{vol.Required(CONF_USERNAME): str, vol.Required(CONF_PASSWORD): str}
),
description_placeholders={CONF_NAME: self._get_reauth_entry().title},
errors=errors,
)

Expand Down
7 changes: 5 additions & 2 deletions homeassistant/components/monzo/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import voluptuous as vol

from homeassistant.config_entries import SOURCE_REAUTH, ConfigFlowResult
from homeassistant.const import CONF_TOKEN
from homeassistant.const import CONF_NAME, CONF_TOKEN
from homeassistant.helpers import config_entry_oauth2_flow

from .const import DOMAIN
Expand Down Expand Up @@ -70,5 +70,8 @@ async def async_step_reauth_confirm(
) -> ConfigFlowResult:
"""Confirm reauth dialog."""
if user_input is None:
return self.async_show_form(step_id="reauth_confirm")
return self.async_show_form(
step_id="reauth_confirm",
description_placeholders={CONF_NAME: self._get_reauth_entry().title},
)
return await self.async_step_user()
3 changes: 2 additions & 1 deletion homeassistant/components/myuplink/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from typing import Any

from homeassistant.config_entries import SOURCE_REAUTH, ConfigFlowResult
from homeassistant.const import CONF_NAME
from homeassistant.helpers import config_entry_oauth2_flow

from .const import DOMAIN, OAUTH2_SCOPES
Expand Down Expand Up @@ -40,8 +41,8 @@ async def async_step_reauth_confirm(
if user_input is None:
return self.async_show_form(
step_id="reauth_confirm",
description_placeholders={CONF_NAME: self._get_reauth_entry().title},
)

return await self.async_step_user()

async def async_oauth_create_entry(self, data: dict) -> ConfigFlowResult:
Expand Down
6 changes: 5 additions & 1 deletion homeassistant/components/nest/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import voluptuous as vol

from homeassistant.config_entries import SOURCE_REAUTH, ConfigFlowResult
from homeassistant.const import CONF_NAME
from homeassistant.helpers import config_entry_oauth2_flow
from homeassistant.util import get_random_string

Expand Down Expand Up @@ -141,7 +142,10 @@ async def async_step_reauth_confirm(
) -> ConfigFlowResult:
"""Confirm reauth dialog."""
if user_input is None:
return self.async_show_form(step_id="reauth_confirm")
return self.async_show_form(
step_id="reauth_confirm",
description_placeholders={CONF_NAME: self._get_reauth_entry().title},
)
return await self.async_step_user()

async def async_step_user(
Expand Down
8 changes: 5 additions & 3 deletions homeassistant/components/netatmo/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
ConfigFlowResult,
OptionsFlow,
)
from homeassistant.const import CONF_SHOW_ON_MAP, CONF_UUID
from homeassistant.const import CONF_NAME, CONF_SHOW_ON_MAP, CONF_UUID
from homeassistant.core import callback
from homeassistant.helpers import config_entry_oauth2_flow, config_validation as cv

Expand Down Expand Up @@ -81,8 +81,10 @@ async def async_step_reauth_confirm(
) -> ConfigFlowResult:
"""Dialog that informs the user that reauth is required."""
if user_input is None:
return self.async_show_form(step_id="reauth_confirm")

return self.async_show_form(
step_id="reauth_confirm",
description_placeholders={CONF_NAME: self._get_reauth_entry().title},
)
return await self.async_step_user()

async def async_oauth_create_entry(self, data: dict) -> ConfigFlowResult:
Expand Down
5 changes: 3 additions & 2 deletions homeassistant/components/notion/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import voluptuous as vol

from homeassistant.config_entries import ConfigFlow, ConfigFlowResult
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
from homeassistant.const import CONF_NAME, CONF_PASSWORD, CONF_USERNAME
from homeassistant.core import HomeAssistant

from .const import CONF_REFRESH_TOKEN, CONF_USER_UUID, DOMAIN, LOGGER
Expand Down Expand Up @@ -85,7 +85,8 @@ async def async_step_reauth_confirm(
step_id="reauth_confirm",
data_schema=REAUTH_SCHEMA,
description_placeholders={
CONF_USERNAME: reauth_entry.data[CONF_USERNAME]
CONF_NAME: self._get_reauth_entry().title,
CFenner marked this conversation as resolved.
Show resolved Hide resolved
CONF_USERNAME: reauth_entry.data[CONF_USERNAME],
},
)

Expand Down
7 changes: 5 additions & 2 deletions homeassistant/components/point/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from homeassistant.components.webhook import async_generate_id
from homeassistant.config_entries import SOURCE_REAUTH, ConfigFlowResult
from homeassistant.const import CONF_TOKEN, CONF_WEBHOOK_ID
from homeassistant.const import CONF_NAME, CONF_TOKEN, CONF_WEBHOOK_ID
from homeassistant.helpers.config_entry_oauth2_flow import AbstractOAuth2FlowHandler

from .const import DOMAIN
Expand Down Expand Up @@ -37,7 +37,10 @@ async def async_step_reauth_confirm(
) -> ConfigFlowResult:
"""Dialog that informs the user that reauth is required."""
if user_input is None:
return self.async_show_form(step_id="reauth_confirm")
return self.async_show_form(
step_id="reauth_confirm",
description_placeholders={CONF_NAME: self._get_reauth_entry().title},
)
return await self.async_step_user()

async def async_oauth_create_entry(self, data: dict[str, Any]) -> ConfigFlowResult:
Expand Down
7 changes: 5 additions & 2 deletions homeassistant/components/ridwell/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import voluptuous as vol

from homeassistant.config_entries import ConfigFlow, ConfigFlowResult
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
from homeassistant.const import CONF_NAME, CONF_PASSWORD, CONF_USERNAME
from homeassistant.helpers import aiohttp_client, config_validation as cv

from .const import DOMAIN, LOGGER
Expand Down Expand Up @@ -96,7 +96,10 @@ async def async_step_reauth_confirm(
return self.async_show_form(
step_id="reauth_confirm",
data_schema=STEP_REAUTH_CONFIRM_DATA_SCHEMA,
description_placeholders={CONF_USERNAME: self._username},
description_placeholders={
CONF_NAME: self._get_reauth_entry().title,
CONF_USERNAME: self._username,
},
)

self._password = user_input[CONF_PASSWORD]
Expand Down
5 changes: 4 additions & 1 deletion homeassistant/components/spotify/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@ async def async_step_reauth_confirm(
if user_input is None:
return self.async_show_form(
step_id="reauth_confirm",
description_placeholders={"account": reauth_entry.data["id"]},
description_placeholders={
CONF_NAME: self._get_reauth_entry().title,
"account": reauth_entry.data["id"],
},
errors={},
)

Expand Down
Loading