Compare commits

...
Sign in to create a new pull request.

3 commits

Author SHA1 Message Date
epenet
f2f829e1c7 Ignore custom integrations 2024-11-13 22:06:03 +00:00
epenet
7c8b95dae6 Exclude mobile_app 2024-11-13 22:03:58 +00:00
epenet
2ca5889326 Log a warning when replacing existing config entry with same unique id 2024-11-13 21:50:19 +00:00

View file

@ -35,6 +35,7 @@ from .const import (
CONF_NAME,
EVENT_HOMEASSISTANT_STARTED,
EVENT_HOMEASSISTANT_STOP,
PATCH_VERSION,
Platform,
)
from .core import (
@ -1483,6 +1484,19 @@ class ConfigEntriesFlowManager(
result["handler"], flow.unique_id
)
if existing_entry is not None and PATCH_VERSION == "0.dev0":
# We temporarily restrict this to `dev` to get a feel for how many
# integrations this concerns
report_usage(
"creates a config entry when another entry with the same unique ID "
"exists, causing the old entry to be removed and replaced when it "
"should most likely update the previous entry and abort the flow",
core_behavior=ReportBehavior.LOG,
core_integration_behavior=ReportBehavior.LOG,
custom_integration_behavior=ReportBehavior.IGNORE,
exclude_integrations={"mobile_app"},
)
# Unload the entry before setting up the new one.
# We will remove it only after the other one is set up,
# so that device customizations are not getting lost.