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
ac7dc036
Unverified
Commit
ac7dc036
authored
6 months ago
by
epenet
Committed by
GitHub
6 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Do not cache the reconfigure entry in holiday config flow (#128005)
parent
253a5e3e
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/holiday/config_flow.py
+5
-9
5 additions, 9 deletions
homeassistant/components/holiday/config_flow.py
with
5 additions
and
9 deletions
homeassistant/components/holiday/config_flow.py
+
5
−
9
View file @
ac7dc036
...
@@ -8,7 +8,7 @@ from babel import Locale, UnknownLocaleError
...
@@ -8,7 +8,7 @@ from babel import Locale, UnknownLocaleError
from
holidays
import
list_supported_countries
from
holidays
import
list_supported_countries
import
voluptuous
as
vol
import
voluptuous
as
vol
from
homeassistant.config_entries
import
ConfigEntry
,
ConfigFlow
,
ConfigFlowResult
from
homeassistant.config_entries
import
ConfigFlow
,
ConfigFlowResult
from
homeassistant.const
import
CONF_COUNTRY
from
homeassistant.const
import
CONF_COUNTRY
from
homeassistant.helpers.selector
import
(
from
homeassistant.helpers.selector
import
(
CountrySelector
,
CountrySelector
,
...
@@ -27,7 +27,6 @@ class HolidayConfigFlow(ConfigFlow, domain=DOMAIN):
...
@@ -27,7 +27,6 @@ class HolidayConfigFlow(ConfigFlow, domain=DOMAIN):
"""
Handle a config flow for Holiday.
"""
"""
Handle a config flow for Holiday.
"""
VERSION
=
1
VERSION
=
1
config_entry
:
ConfigEntry
def
__init__
(
self
)
->
None
:
def
__init__
(
self
)
->
None
:
"""
Initialize the config flow.
"""
"""
Initialize the config flow.
"""
...
@@ -115,15 +114,15 @@ class HolidayConfigFlow(ConfigFlow, domain=DOMAIN):
...
@@ -115,15 +114,15 @@ class HolidayConfigFlow(ConfigFlow, domain=DOMAIN):
self
,
user_input
:
dict
[
str
,
Any
]
|
None
=
None
self
,
user_input
:
dict
[
str
,
Any
]
|
None
=
None
)
->
ConfigFlowResult
:
)
->
ConfigFlowResult
:
"""
Handle the re-configuration of a province.
"""
"""
Handle the re-configuration of a province.
"""
self
.
config_entry
=
self
.
_get_reconfigure_entry
()
return
await
self
.
async_step_reconfigure_confirm
()
return
await
self
.
async_step_reconfigure_confirm
()
async
def
async_step_reconfigure_confirm
(
async
def
async_step_reconfigure_confirm
(
self
,
user_input
:
dict
[
str
,
Any
]
|
None
=
None
self
,
user_input
:
dict
[
str
,
Any
]
|
None
=
None
)
->
ConfigFlowResult
:
)
->
ConfigFlowResult
:
"""
Handle the re-configuration of a province.
"""
"""
Handle the re-configuration of a province.
"""
reconfigure_entry
=
self
.
_get_reconfigure_entry
()
if
user_input
is
not
None
:
if
user_input
is
not
None
:
combined_input
:
dict
[
str
,
Any
]
=
{
**
self
.
config_entry
.
data
,
**
user_input
}
combined_input
:
dict
[
str
,
Any
]
=
{
**
re
config
ure
_entry
.
data
,
**
user_input
}
country
=
combined_input
[
CONF_COUNTRY
]
country
=
combined_input
[
CONF_COUNTRY
]
province
=
combined_input
.
get
(
CONF_PROVINCE
)
province
=
combined_input
.
get
(
CONF_PROVINCE
)
...
@@ -145,10 +144,7 @@ class HolidayConfigFlow(ConfigFlow, domain=DOMAIN):
...
@@ -145,10 +144,7 @@ class HolidayConfigFlow(ConfigFlow, domain=DOMAIN):
name
=
f
"
{
locale
.
territories
[
country
]
}{
province_str
}
"
name
=
f
"
{
locale
.
territories
[
country
]
}{
province_str
}
"
return
self
.
async_update_reload_and_abort
(
return
self
.
async_update_reload_and_abort
(
self
.
config_entry
,
reconfigure_entry
,
title
=
name
,
data
=
combined_input
title
=
name
,
data
=
combined_input
,
reason
=
"
reconfigure_successful
"
,
)
)
province_schema
=
vol
.
Schema
(
province_schema
=
vol
.
Schema
(
...
@@ -156,7 +152,7 @@ class HolidayConfigFlow(ConfigFlow, domain=DOMAIN):
...
@@ -156,7 +152,7 @@ class HolidayConfigFlow(ConfigFlow, domain=DOMAIN):
vol
.
Optional
(
CONF_PROVINCE
):
SelectSelector
(
vol
.
Optional
(
CONF_PROVINCE
):
SelectSelector
(
SelectSelectorConfig
(
SelectSelectorConfig
(
options
=
SUPPORTED_COUNTRIES
[
options
=
SUPPORTED_COUNTRIES
[
self
.
config_entry
.
data
[
CONF_COUNTRY
]
re
config
ure
_entry
.
data
[
CONF_COUNTRY
]
],
],
mode
=
SelectSelectorMode
.
DROPDOWN
,
mode
=
SelectSelectorMode
.
DROPDOWN
,
)
)
...
...
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