Fix async_update_reload_and_abort only reload if no update listener

This commit is contained in:
G Johansson 2024-12-17 20:21:23 +00:00
parent 3160b7baa0
commit 3b5b71e458

View File

@ -3240,6 +3240,7 @@ class ConfigFlow(ConfigEntryBaseFlow):
if data is not UNDEFINED: if data is not UNDEFINED:
raise ValueError("Cannot set both data and data_updates") raise ValueError("Cannot set both data and data_updates")
data = entry.data | data_updates data = entry.data | data_updates
update_listener_exist = bool(entry.update_listeners)
result = self.hass.config_entries.async_update_entry( result = self.hass.config_entries.async_update_entry(
entry=entry, entry=entry,
unique_id=unique_id, unique_id=unique_id,
@ -3247,7 +3248,9 @@ class ConfigFlow(ConfigEntryBaseFlow):
data=data, data=data,
options=options, options=options,
) )
if reload_even_if_entry_is_unchanged or result: if reload_even_if_entry_is_unchanged or (
update_listener_exist is False and result is True
):
self.hass.config_entries.async_schedule_reload(entry.entry_id) self.hass.config_entries.async_schedule_reload(entry.entry_id)
if reason is UNDEFINED: if reason is UNDEFINED:
reason = "reauth_successful" reason = "reauth_successful"