From 5b26cd3dae04bee0be14016d492067f8ce41f353 Mon Sep 17 00:00:00 2001 From: Daniel <49846893+danielbrunt57@users.noreply.github.com> Date: Fri, 20 Sep 2024 17:26:14 -0700 Subject: [PATCH] fix: fix typo in in_progress_instances (#2541) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- custom_components/alexa_media/__init__.py | 6 +++--- custom_components/alexa_media/config_flow.py | 10 +++++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/custom_components/alexa_media/__init__.py b/custom_components/alexa_media/__init__.py index 3dca0bf7..d561e3c5 100644 --- a/custom_components/alexa_media/__init__.py +++ b/custom_components/alexa_media/__init__.py @@ -54,7 +54,7 @@ import voluptuous as vol from .alexa_entity import AlexaEntityData, get_entity_data, parse_alexa_entities -from .config_flow import in_progess_instances +from .config_flow import in_progress_instances from .const import ( ALEXA_COMPONENTS, CONF_ACCOUNTS, @@ -1451,7 +1451,7 @@ async def test_login_status(hass, config_entry, login) -> bool: if login.status and login.status.get("login_successful"): return True account = config_entry.data - _LOGGER.debug("Logging in: %s %s", obfuscate(account), in_progess_instances(hass)) + _LOGGER.debug("Logging in: %s %s", obfuscate(account), in_progress_instances(hass)) _LOGGER.debug("Login stats: %s", login.stats) message: str = ( f"Reauthenticate {login.email} on the [Integrations](/config/integrations) page. " @@ -1470,7 +1470,7 @@ async def test_login_status(hass, config_entry, login) -> bool: f"{account[CONF_EMAIL]} - {account[CONF_URL]}" ) if flow: - if flow.get("flow_id") in in_progess_instances(hass): + if flow.get("flow_id") in in_progress_instances(hass): _LOGGER.debug("Existing config flow detected") return False _LOGGER.debug("Stopping orphaned config flow %s", flow.get("flow_id")) diff --git a/custom_components/alexa_media/config_flow.py b/custom_components/alexa_media/config_flow.py index 98d2b879..a026c163 100644 --- a/custom_components/alexa_media/config_flow.py +++ b/custom_components/alexa_media/config_flow.py @@ -84,9 +84,13 @@ def configured_instances(hass): @callback -def in_progess_instances(hass): - """Return a set of in progress Alexa Media flows.""" - return {entry["flow_id"] for entry in hass.config_entries.flow.async_progress()} +def in_progress_instances(hass): + """Return a set of in-progress Alexa Media flows.""" + return { + entry["flow_id"] + for entry in hass.config_entries.flow.async_progress() + if entry["handler"] == DOMAIN # Ensure only Alexa Media flows are included + } @config_entries.HANDLERS.register(DOMAIN)