Skip to content

Commit 5802be3

Browse files
committed
Revert "Don't cancel reauth when reload is triggered by a reauth flow"
This reverts commit f37c756.
1 parent f37c756 commit 5802be3

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

homeassistant/config_entries.py

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2233,18 +2233,16 @@ async def async_unload(self, entry_id: str, _lock: bool = True) -> bool:
22332233
return await entry.async_unload(self.hass)
22342234

22352235
@callback
2236-
def async_schedule_reload(
2237-
self, entry_id: str, *, cancel_reauth: bool = True
2238-
) -> None:
2236+
def async_schedule_reload(self, entry_id: str) -> None:
22392237
"""Schedule a config entry to be reloaded."""
22402238
entry = self.async_get_known_entry(entry_id)
22412239
entry.async_cancel_retry_setup()
22422240
self.hass.async_create_task(
2243-
self.async_reload(entry_id, cancel_reauth=cancel_reauth),
2241+
self.async_reload(entry_id),
22442242
f"config entry reload {entry.title} {entry.domain} {entry.entry_id}",
22452243
)
22462244

2247-
async def async_reload(self, entry_id: str, *, cancel_reauth: bool = True) -> bool:
2245+
async def async_reload(self, entry_id: str) -> bool:
22482246
"""Reload an entry.
22492247
22502248
When reloading from an integration is is preferable to
@@ -2263,9 +2261,8 @@ async def async_reload(self, entry_id: str, *, cancel_reauth: bool = True) -> bo
22632261
entry.async_cancel_retry_setup()
22642262

22652263
# Abort any in-progress reauth flow and linked issues
2266-
if cancel_reauth:
2267-
_abort_reauth_flows(self.hass, entry.domain, entry_id)
2268-
_remove_reauth_issue(self.hass, entry.domain, entry_id)
2264+
_abort_reauth_flows(self.hass, entry.domain, entry_id)
2265+
_remove_reauth_issue(self.hass, entry.domain, entry_id)
22692266

22702267
if entry.domain not in self.hass.config.components:
22712268
# If the component is not loaded, just load it as
@@ -3266,9 +3263,7 @@ def async_update_reload_and_abort(
32663263
options=options,
32673264
)
32683265
if reload_even_if_entry_is_unchanged or result:
3269-
self.hass.config_entries.async_schedule_reload(
3270-
entry.entry_id, cancel_reauth=self.source != SOURCE_REAUTH
3271-
)
3266+
self.hass.config_entries.async_schedule_reload(entry.entry_id)
32723267
if reason is UNDEFINED:
32733268
reason = "reauth_successful"
32743269
if self.source == SOURCE_RECONFIGURE:

0 commit comments

Comments
 (0)