From a9c39cc4a3c86c133bb874530c908ac36a6fe064 Mon Sep 17 00:00:00 2001 From: kingpanther13 <25392815+kingpanther13@users.noreply.github.com> Date: Sat, 4 Jul 2026 18:35:15 -0400 Subject: [PATCH] Scope integration discovery to custom_components --- scripts/helpers/integration_path.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/scripts/helpers/integration_path.py b/scripts/helpers/integration_path.py index edeb8b3337..9b7f06756f 100644 --- a/scripts/helpers/integration_path.py +++ b/scripts/helpers/integration_path.py @@ -1,11 +1,20 @@ -import json import os from glob import glob def get_integration_path(): + base = "/tmp/repositories/addition" + # Per the publishing docs, an integration lives in + # ROOT/custom_components/. Scope the search there when the + # directory exists so repositories that also ship other manifest.json + # files (add-ons, test fixtures) resolve to the integration; fall back + # to the whole clone for content_in_root repositories. + search_root = os.path.join(base, "custom_components") + if not os.path.isdir(search_root): + search_root = base + files = [] - for dir, _, _ in os.walk("/tmp/repositories/addition"): + for dir, _, _ in os.walk(search_root): files.extend(glob(os.path.join(dir, "*manifest.json"))) if len(files) != 1: