Home Assistant Unofficial Reference
2024.12.1
config_flow.py
Go to the documentation of this file.
1
"""Config flow for Ondilo ICO."""
2
3
import
logging
4
from
typing
import
Any
5
6
from
homeassistant.config_entries
import
ConfigFlowResult
7
from
homeassistant.helpers.config_entry_oauth2_flow
import
AbstractOAuth2FlowHandler
8
9
from
.const
import
DOMAIN
10
from
.oauth_impl
import
OndiloOauth2Implementation
11
12
13
class
OndiloIcoOAuth2FlowHandler
(
AbstractOAuth2FlowHandler
, domain=DOMAIN):
14
"""Config flow to handle Ondilo ICO OAuth2 authentication."""
15
16
DOMAIN = DOMAIN
17
18
async
def
async_step_user
(
19
self, user_input: dict[str, Any] |
None
=
None
20
) -> ConfigFlowResult:
21
"""Handle a flow initialized by the user."""
22
await self.
async_set_unique_id
async_set_unique_id(DOMAIN)
23
24
self.
async_register_implementation
async_register_implementation(
25
self.hass,
26
OndiloOauth2Implementation
(self.hass),
27
)
28
29
return
await super().
async_step_user
(user_input)
30
31
@property
32
def
logger
(self) -> logging.Logger:
33
"""Return logger."""
34
return
logging.getLogger(__name__)
35
36
@property
37
def
extra_authorize_data
(self) -> dict:
38
"""Extra data that needs to be appended to the authorize url."""
39
return
{
"scope"
:
"api"
}
homeassistant.components.ondilo_ico.config_flow.OndiloIcoOAuth2FlowHandler
Definition:
config_flow.py:13
homeassistant.components.ondilo_ico.config_flow.OndiloIcoOAuth2FlowHandler.logger
logging.Logger logger(self)
Definition:
config_flow.py:32
homeassistant.components.ondilo_ico.config_flow.OndiloIcoOAuth2FlowHandler.extra_authorize_data
dict extra_authorize_data(self)
Definition:
config_flow.py:37
homeassistant.components.ondilo_ico.config_flow.OndiloIcoOAuth2FlowHandler.async_step_user
ConfigFlowResult async_step_user(self, dict[str, Any]|None user_input=None)
Definition:
config_flow.py:20
homeassistant.components.ondilo_ico.oauth_impl.OndiloOauth2Implementation
Definition:
oauth_impl.py:15
homeassistant.config_entries.ConfigFlow.async_set_unique_id
ConfigEntry|None async_set_unique_id(self, str|None unique_id=None, *bool raise_on_progress=True)
Definition:
config_entries.py:2672
homeassistant.helpers.config_entry_oauth2_flow.AbstractOAuth2FlowHandler
Definition:
config_entry_oauth2_flow.py:230
homeassistant.helpers.config_entry_oauth2_flow.AbstractOAuth2FlowHandler.async_register_implementation
None async_register_implementation(cls, HomeAssistant hass, LocalOAuth2Implementation local_impl)
Definition:
config_entry_oauth2_flow.py:392
homeassistant.config_entries
Definition:
config_entries.py:1
homeassistant.helpers.config_entry_oauth2_flow
Definition:
config_entry_oauth2_flow.py:1
core
homeassistant
components
ondilo_ico
config_flow.py
Generated by
1.9.1