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
c6fa160c
Unverified
Commit
c6fa160c
authored
6 months ago
by
epenet
Committed by
GitHub
6 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Use _get_reauth/reconfigure_entry in nam (#127303)
parent
e2eb986c
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/nam/config_flow.py
+7
-15
7 additions, 15 deletions
homeassistant/components/nam/config_flow.py
with
7 additions
and
15 deletions
homeassistant/components/nam/config_flow.py
+
7
−
15
View file @
c6fa160c
...
@@ -5,7 +5,7 @@ from __future__ import annotations
...
@@ -5,7 +5,7 @@ from __future__ import annotations
from
collections.abc
import
Mapping
from
collections.abc
import
Mapping
from
dataclasses
import
dataclass
from
dataclasses
import
dataclass
import
logging
import
logging
from
typing
import
TYPE_CHECKING
,
Any
from
typing
import
Any
from
aiohttp.client_exceptions
import
ClientConnectorError
from
aiohttp.client_exceptions
import
ClientConnectorError
from
nettigo_air_monitor
import
(
from
nettigo_air_monitor
import
(
...
@@ -72,11 +72,9 @@ class NAMFlowHandler(ConfigFlow, domain=DOMAIN):
...
@@ -72,11 +72,9 @@ class NAMFlowHandler(ConfigFlow, domain=DOMAIN):
VERSION
=
1
VERSION
=
1
def
__init__
(
self
)
->
None
:
_config
:
NamConfig
"""
Initialize flow.
"""
entry
:
ConfigEntry
self
.
host
:
str
host
:
str
self
.
entry
:
ConfigEntry
self
.
_config
:
NamConfig
async
def
async_step_user
(
async
def
async_step_user
(
self
,
user_input
:
dict
[
str
,
Any
]
|
None
=
None
self
,
user_input
:
dict
[
str
,
Any
]
|
None
=
None
...
@@ -189,8 +187,7 @@ class NAMFlowHandler(ConfigFlow, domain=DOMAIN):
...
@@ -189,8 +187,7 @@ class NAMFlowHandler(ConfigFlow, domain=DOMAIN):
self
,
entry_data
:
Mapping
[
str
,
Any
]
self
,
entry_data
:
Mapping
[
str
,
Any
]
)
->
ConfigFlowResult
:
)
->
ConfigFlowResult
:
"""
Handle configuration by re-auth.
"""
"""
Handle configuration by re-auth.
"""
if
entry
:
=
self
.
hass
.
config_entries
.
async_get_entry
(
self
.
context
[
"
entry_id
"
]):
self
.
entry
=
self
.
_get_reauth_entry
()
self
.
entry
=
entry
self
.
host
=
entry_data
[
CONF_HOST
]
self
.
host
=
entry_data
[
CONF_HOST
]
self
.
context
[
"
title_placeholders
"
]
=
{
"
host
"
:
self
.
host
}
self
.
context
[
"
title_placeholders
"
]
=
{
"
host
"
:
self
.
host
}
return
await
self
.
async_step_reauth_confirm
()
return
await
self
.
async_step_reauth_confirm
()
...
@@ -229,13 +226,8 @@ class NAMFlowHandler(ConfigFlow, domain=DOMAIN):
...
@@ -229,13 +226,8 @@ class NAMFlowHandler(ConfigFlow, domain=DOMAIN):
self
,
entry_data
:
Mapping
[
str
,
Any
]
self
,
entry_data
:
Mapping
[
str
,
Any
]
)
->
ConfigFlowResult
:
)
->
ConfigFlowResult
:
"""
Handle a reconfiguration flow initialized by the user.
"""
"""
Handle a reconfiguration flow initialized by the user.
"""
entry
=
self
.
hass
.
config_entries
.
async_get_entry
(
self
.
context
[
"
entry_id
"
])
self
.
entry
=
self
.
_get_reconfigure_entry
()
self
.
host
=
self
.
entry
.
data
[
CONF_HOST
]
if
TYPE_CHECKING
:
assert
entry
is
not
None
self
.
host
=
entry
.
data
[
CONF_HOST
]
self
.
entry
=
entry
return
await
self
.
async_step_reconfigure_confirm
()
return
await
self
.
async_step_reconfigure_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