Remove reauth persistent notification (#140932)

* Remove persistent notification created when starting reauth

* Update netatmo tests
This commit is contained in:
Erik Montnemery
2025-03-24 09:29:14 +01:00
committed by GitHub
parent 12e001cf2b
commit ab9d29bf9d
3 changed files with 6 additions and 122 deletions

View File

@@ -195,8 +195,6 @@ DISCOVERY_SOURCES = {
SOURCE_ZEROCONF,
}
RECONFIGURE_NOTIFICATION_ID = "config_entry_reconfigure"
EVENT_FLOW_DISCOVERED = "config_entry_discovered"
SIGNAL_CONFIG_ENTRY_CHANGED = SignalType["ConfigEntryChange", "ConfigEntry"](
@@ -1714,16 +1712,6 @@ class ConfigEntriesFlowManager(
# Create notification.
if source in DISCOVERY_SOURCES:
await self._discovery_debouncer.async_call()
elif source == SOURCE_REAUTH:
persistent_notification.async_create(
self.hass,
title="Integration requires reconfiguration",
message=(
"At least one of your integrations requires reconfiguration to "
"continue functioning. [Check it out](/config/integrations)."
),
notification_id=RECONFIGURE_NOTIFICATION_ID,
)
@callback
def _async_discovery(self) -> None:
@@ -3119,29 +3107,6 @@ class ConfigFlow(ConfigEntryBaseFlow):
"""Handle a flow initialized by discovery."""
return await self._async_step_discovery_without_unique_id()
@callback
def async_abort(
self,
*,
reason: str,
description_placeholders: Mapping[str, str] | None = None,
) -> ConfigFlowResult:
"""Abort the config flow."""
# Remove reauth notification if no reauth flows are in progress
if self.source == SOURCE_REAUTH and not any(
ent["flow_id"] != self.flow_id
for ent in self.hass.config_entries.flow.async_progress_by_handler(
self.handler, match_context={"source": SOURCE_REAUTH}
)
):
persistent_notification.async_dismiss(
self.hass, RECONFIGURE_NOTIFICATION_ID
)
return super().async_abort(
reason=reason, description_placeholders=description_placeholders
)
async def async_step_bluetooth(
self, discovery_info: BluetoothServiceInfoBleak
) -> ConfigFlowResult: