1 """Config flow for myUplink."""
3 from collections.abc
import Mapping
10 from .const
import DOMAIN, OAUTH2_SCOPES
14 config_entry_oauth2_flow.AbstractOAuth2FlowHandler, domain=DOMAIN
16 """Config flow to handle myUplink OAuth2 authentication."""
23 return logging.getLogger(__name__)
27 """Extra data that needs to be appended to the authorize url."""
28 return {
"scope":
" ".join(OAUTH2_SCOPES)}
31 self, entry_data: Mapping[str, Any]
32 ) -> ConfigFlowResult:
33 """Perform reauth upon an API authentication error."""
37 self, user_input: Mapping[str, Any] |
None =
None
38 ) -> ConfigFlowResult:
39 """Dialog that informs the user that reauth is required."""
40 if user_input
is None:
41 return self.async_show_form(
42 step_id=
"reauth_confirm",
45 return await self.async_step_user()
48 """Create or update the config entry."""
49 if self.
sourcesource == SOURCE_REAUTH:
50 return self.async_update_reload_and_abort(
51 self._get_reauth_entry(), data=data
ConfigFlowResult async_oauth_create_entry(self, dict data)
ConfigFlowResult async_step_reauth_confirm(self, Mapping[str, Any]|None user_input=None)
logging.Logger logger(self)
dict[str, Any] extra_authorize_data(self)
ConfigFlowResult async_step_reauth(self, Mapping[str, Any] entry_data)