Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mirrored_repos
HomeAssistant
Core
Commits
bb21c878
Unverified
Commit
bb21c878
authored
5 months ago
by
epenet
Committed by
GitHub
5 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Use _get_reauth_entry in aseko_pool_live (#127319)
parent
f0df25f8
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
homeassistant/components/aseko_pool_live/config_flow.py
+9
-7
9 additions, 7 deletions
homeassistant/components/aseko_pool_live/config_flow.py
with
9 additions
and
7 deletions
homeassistant/components/aseko_pool_live/config_flow.py
+
9
−
7
View file @
bb21c878
...
@@ -9,7 +9,12 @@ from typing import Any
...
@@ -9,7 +9,12 @@ from typing import Any
from
aioaseko
import
Aseko
,
AsekoAPIError
,
AsekoInvalidCredentials
from
aioaseko
import
Aseko
,
AsekoAPIError
,
AsekoInvalidCredentials
import
voluptuous
as
vol
import
voluptuous
as
vol
from
homeassistant.config_entries
import
ConfigEntry
,
ConfigFlow
,
ConfigFlowResult
from
homeassistant.config_entries
import
(
SOURCE_REAUTH
,
ConfigEntry
,
ConfigFlow
,
ConfigFlowResult
,
)
from
homeassistant.const
import
CONF_EMAIL
,
CONF_PASSWORD
,
CONF_UNIQUE_ID
from
homeassistant.const
import
CONF_EMAIL
,
CONF_PASSWORD
,
CONF_UNIQUE_ID
from
.const
import
DOMAIN
from
.const
import
DOMAIN
...
@@ -29,7 +34,7 @@ class AsekoConfigFlow(ConfigFlow, domain=DOMAIN):
...
@@ -29,7 +34,7 @@ class AsekoConfigFlow(ConfigFlow, domain=DOMAIN):
}
}
)
)
reauth_entry
:
ConfigEntry
|
None
=
None
reauth_entry
:
ConfigEntry
async
def
get_account_info
(
self
,
email
:
str
,
password
:
str
)
->
dict
:
async
def
get_account_info
(
self
,
email
:
str
,
password
:
str
)
->
dict
:
"""
Get account info from the mobile API and the web API.
"""
"""
Get account info from the mobile API and the web API.
"""
...
@@ -46,7 +51,6 @@ class AsekoConfigFlow(ConfigFlow, domain=DOMAIN):
...
@@ -46,7 +51,6 @@ class AsekoConfigFlow(ConfigFlow, domain=DOMAIN):
)
->
ConfigFlowResult
:
)
->
ConfigFlowResult
:
"""
Handle the initial step.
"""
"""
Handle the initial step.
"""
self
.
reauth_entry
=
None
errors
=
{}
errors
=
{}
if
user_input
is
not
None
:
if
user_input
is
not
None
:
...
@@ -73,7 +77,7 @@ class AsekoConfigFlow(ConfigFlow, domain=DOMAIN):
...
@@ -73,7 +77,7 @@ class AsekoConfigFlow(ConfigFlow, domain=DOMAIN):
async
def
async_store_credentials
(
self
,
info
:
dict
[
str
,
Any
])
->
ConfigFlowResult
:
async
def
async_store_credentials
(
self
,
info
:
dict
[
str
,
Any
])
->
ConfigFlowResult
:
"""
Store validated credentials.
"""
"""
Store validated credentials.
"""
if
self
.
reauth_entry
:
if
self
.
source
==
SOURCE_REAUTH
:
self
.
hass
.
config_entries
.
async_update_entry
(
self
.
hass
.
config_entries
.
async_update_entry
(
self
.
reauth_entry
,
self
.
reauth_entry
,
title
=
info
[
CONF_EMAIL
],
title
=
info
[
CONF_EMAIL
],
...
@@ -101,9 +105,7 @@ class AsekoConfigFlow(ConfigFlow, domain=DOMAIN):
...
@@ -101,9 +105,7 @@ class AsekoConfigFlow(ConfigFlow, domain=DOMAIN):
)
->
ConfigFlowResult
:
)
->
ConfigFlowResult
:
"""
Perform reauth upon an API authentication error.
"""
"""
Perform reauth upon an API authentication error.
"""
self
.
reauth_entry
=
self
.
hass
.
config_entries
.
async_get_entry
(
self
.
reauth_entry
=
self
.
_get_reauth_entry
()
self
.
context
[
"
entry_id
"
]
)
return
await
self
.
async_step_reauth_confirm
()
return
await
self
.
async_step_reauth_confirm
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment