Add SOURCE_SYSTEM to DISCOVERY_SOURCES (#128457)

This commit is contained in:
epenet 2024-10-16 11:27:48 +02:00 committed by GitHub
parent 1ff1b82fc7
commit 8ae8fa7ec9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 4 deletions

View File

@ -175,6 +175,7 @@ DISCOVERY_SOURCES = {
SOURCE_INTEGRATION_DISCOVERY, SOURCE_INTEGRATION_DISCOVERY,
SOURCE_MQTT, SOURCE_MQTT,
SOURCE_SSDP, SOURCE_SSDP,
SOURCE_SYSTEM,
SOURCE_USB, SOURCE_USB,
SOURCE_ZEROCONF, SOURCE_ZEROCONF,
} }

View File

@ -13,7 +13,6 @@ import pytest
from homeassistant.config_entries import ( from homeassistant.config_entries import (
DISCOVERY_SOURCES, DISCOVERY_SOURCES,
SOURCE_SYSTEM,
ConfigEntriesFlowManager, ConfigEntriesFlowManager,
FlowResult, FlowResult,
) )
@ -540,9 +539,7 @@ def check_config_translations(ignore_translations: str | list[str]) -> Generator
if result["type"] is FlowResultType.ABORT: if result["type"] is FlowResultType.ABORT:
# We don't need translations for a discovery flow which immediately # We don't need translations for a discovery flow which immediately
# aborts, since such flows won't be seen by users # aborts, since such flows won't be seen by users
if not flow.__flow_seen_before and ( if not flow.__flow_seen_before and flow.source in DISCOVERY_SOURCES:
flow.source == SOURCE_SYSTEM or flow.source in DISCOVERY_SOURCES
):
return result return result
await _ensure_translation_exists( await _ensure_translation_exists(
flow.hass, flow.hass,