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
3d1e5776
Unverified
Commit
3d1e5776
authored
6 months ago
by
epenet
Committed by
GitHub
6 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Simplify jewish_calendar reconfigure flow (#128008)
* Simplify jewish_calendar reconfigure flow * Adjust
parent
dd083811
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
homeassistant/components/jewish_calendar/config_flow.py
+4
-13
4 additions, 13 deletions
homeassistant/components/jewish_calendar/config_flow.py
tests/components/jewish_calendar/test_config_flow.py
+1
-1
1 addition, 1 deletion
tests/components/jewish_calendar/test_config_flow.py
with
5 additions
and
14 deletions
homeassistant/components/jewish_calendar/config_flow.py
+
4
−
13
View file @
3d1e5776
...
...
@@ -87,7 +87,6 @@ class JewishCalendarConfigFlow(ConfigFlow, domain=DOMAIN):
"""
Handle a config flow for Jewish calendar.
"""
VERSION
=
1
_config_entry
:
ConfigEntry
@staticmethod
@callback
...
...
@@ -133,25 +132,17 @@ class JewishCalendarConfigFlow(ConfigFlow, domain=DOMAIN):
self
,
user_input
:
dict
[
str
,
Any
]
|
None
=
None
)
->
ConfigFlowResult
:
"""
Handle a reconfiguration flow initialized by the user.
"""
self
.
_config_entry
=
self
.
_get_reconfigure_entry
()
return
await
self
.
async_step_reconfigure_confirm
()
async
def
async_step_reconfigure_confirm
(
self
,
user_input
:
dict
[
str
,
Any
]
|
None
=
None
)
->
ConfigFlowResult
:
"""
Handle a reconfiguration flow initialized by the user.
"""
reconfigure_entry
=
self
.
_get_reconfigure_entry
()
if
not
user_input
:
return
self
.
async_show_form
(
data_schema
=
self
.
add_suggested_values_to_schema
(
_get_data_schema
(
self
.
hass
),
{
**
self
.
_
config_entry
.
data
}
,
re
config
ure
_entry
.
data
,
),
step_id
=
"
reconfigure
_confirm
"
,
step_id
=
"
reconfigure
"
,
)
return
self
.
async_update_reload_and_abort
(
self
.
_config_entry
,
data
=
user_input
,
reason
=
"
reconfigure_successful
"
)
return
self
.
async_update_reload_and_abort
(
reconfigure_entry
,
data
=
user_input
)
class
JewishCalendarOptionsFlowHandler
(
OptionsFlowWithConfigEntry
):
...
...
This diff is collapsed.
Click to expand it.
tests/components/jewish_calendar/test_config_flow.py
+
1
−
1
View file @
3d1e5776
...
...
@@ -177,7 +177,7 @@ async def test_reconfigure(
# init user flow
result
=
await
mock_config_entry
.
start_reconfigure_flow
(
hass
)
assert
result
[
"
type
"
]
is
FlowResultType
.
FORM
assert
result
[
"
step_id
"
]
==
"
reconfigure
_confirm
"
assert
result
[
"
step_id
"
]
==
"
reconfigure
"
# success
result
=
await
hass
.
config_entries
.
flow
.
async_configure
(
...
...
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